Update of /project/cl-ppcre/cvsroot/cl-ppcre In directory common-lisp.net:/tmp/cvs-serv918
Modified Files: api.lisp cl-ppcre-test.asd cl-ppcre-test.system cl-ppcre.asd cl-ppcre.system closures.lisp convert.lisp errors.lisp lexer.lisp load.lisp optimize.lisp packages.lisp parser.lisp ppcre-tests.lisp regex-class.lisp repetition-closures.lisp scanner.lisp specials.lisp util.lisp Log Message: pre-0.7.7, including hyperdoc support
Date: Thu Apr 22 14:53:13 2004 Author: eweitz
Index: cl-ppcre/api.lisp diff -u cl-ppcre/api.lisp:1.1.1.1 cl-ppcre/api.lisp:1.2 --- cl-ppcre/api.lisp:1.1.1.1 Tue Jan 6 19:57:41 2004 +++ cl-ppcre/api.lisp Thu Apr 22 14:53:13 2004 @@ -1,9 +1,9 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-PPCRE; Base: 10 -*- -;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/api.lisp,v 1.1.1.1 2004/01/07 00:57:41 eweitz Exp $ +;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/api.lisp,v 1.2 2004/04/22 18:53:13 eweitz Exp $
;;; The external API for creating and using scanners.
-;;; Copyright (c) 2002-2003, Dr. Edmund Weitz. All rights reserved. +;;; Copyright (c) 2002-2004, Dr. Edmund Weitz. All rights reserved.
;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions @@ -555,7 +555,7 @@ (push end pos-list) ;; now collect substrings (nreverse - (loop with substr-fn = (if sharedp #'nsubseq #'nsubseq) + (loop with substr-fn = (if sharedp #'nsubseq #'subseq) with string-seen = nil for (this-end this-start) on pos-list by #'cddr ;; skip empty strings from end of list @@ -568,6 +568,14 @@ (funcall substr-fn target-string this-start this-end) nil))))) + +(define-compiler-macro split (&whole form regex target-string &rest rest) + "Make sure that constant forms are compiled into scanners at compile time." + (cond ((constantp regex) + `(split (load-time-value + (create-scanner ,regex)) + ,target-string ,@rest)) + (t form)))
(defun string-case-modifier (str from to start end) (declare (optimize speed
Index: cl-ppcre/cl-ppcre-test.asd diff -u cl-ppcre/cl-ppcre-test.asd:1.1.1.1 cl-ppcre/cl-ppcre-test.asd:1.2 --- cl-ppcre/cl-ppcre-test.asd:1.1.1.1 Tue Jan 6 19:58:42 2004 +++ cl-ppcre/cl-ppcre-test.asd Thu Apr 22 14:53:13 2004 @@ -1,9 +1,9 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*- -;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/cl-ppcre-test.asd,v 1.1.1.1 2004/01/07 00:58:42 eweitz Exp $ +;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/cl-ppcre-test.asd,v 1.2 2004/04/22 18:53:13 eweitz Exp $
;;; This ASDF system definition was kindly provided by Marco Baringer.
-;;; Copyright (c) 2002-2003, Dr. Edmund Weitz. All rights reserved. +;;; Copyright (c) 2002-2004, Dr. Edmund Weitz. All rights reserved.
;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions
Index: cl-ppcre/cl-ppcre-test.system diff -u cl-ppcre/cl-ppcre-test.system:1.1.1.1 cl-ppcre/cl-ppcre-test.system:1.2 --- cl-ppcre/cl-ppcre-test.system:1.1.1.1 Tue Jan 6 19:57:36 2004 +++ cl-ppcre/cl-ppcre-test.system Thu Apr 22 14:53:13 2004 @@ -1,7 +1,7 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*- -;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/cl-ppcre-test.system,v 1.1.1.1 2004/01/07 00:57:36 eweitz Exp $ +;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/cl-ppcre-test.system,v 1.2 2004/04/22 18:53:13 eweitz Exp $
-;;; Copyright (c) 2002-2003, Dr. Edmund Weitz. All rights reserved. +;;; Copyright (c) 2002-2004, Dr. Edmund Weitz. All rights reserved.
;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions
Index: cl-ppcre/cl-ppcre.asd diff -u cl-ppcre/cl-ppcre.asd:1.1.1.1 cl-ppcre/cl-ppcre.asd:1.2 --- cl-ppcre/cl-ppcre.asd:1.1.1.1 Tue Jan 6 19:57:35 2004 +++ cl-ppcre/cl-ppcre.asd Thu Apr 22 14:53:13 2004 @@ -1,9 +1,9 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*- -;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/cl-ppcre.asd,v 1.1.1.1 2004/01/07 00:57:35 eweitz Exp $ +;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/cl-ppcre.asd,v 1.2 2004/04/22 18:53:13 eweitz Exp $
;;; This ASDF system definition was kindly provided by Marco Baringer.
-;;; Copyright (c) 2002-2003, Dr. Edmund Weitz. All rights reserved. +;;; Copyright (c) 2002-2004, Dr. Edmund Weitz. All rights reserved.
;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions
Index: cl-ppcre/cl-ppcre.system diff -u cl-ppcre/cl-ppcre.system:1.1.1.1 cl-ppcre/cl-ppcre.system:1.2 --- cl-ppcre/cl-ppcre.system:1.1.1.1 Tue Jan 6 19:58:47 2004 +++ cl-ppcre/cl-ppcre.system Thu Apr 22 14:53:13 2004 @@ -1,7 +1,7 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*- -;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/cl-ppcre.system,v 1.1.1.1 2004/01/07 00:58:47 eweitz Exp $ +;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/cl-ppcre.system,v 1.2 2004/04/22 18:53:13 eweitz Exp $
-;;; Copyright (c) 2002-2003, Dr. Edmund Weitz. All rights reserved. +;;; Copyright (c) 2002-2004, Dr. Edmund Weitz. All rights reserved.
;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions
Index: cl-ppcre/closures.lisp diff -u cl-ppcre/closures.lisp:1.1.1.1 cl-ppcre/closures.lisp:1.2 --- cl-ppcre/closures.lisp:1.1.1.1 Tue Jan 6 19:58:43 2004 +++ cl-ppcre/closures.lisp Thu Apr 22 14:53:13 2004 @@ -1,10 +1,10 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-PPCRE; Base: 10 -*- -;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/closures.lisp,v 1.1.1.1 2004/01/07 00:58:43 eweitz Exp $ +;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/closures.lisp,v 1.2 2004/04/22 18:53:13 eweitz Exp $
;;; Here we create the closures which together build the final ;;; scanner.
-;;; Copyright (c) 2002-2003, Dr. Edmund Weitz. All rights reserved. +;;; Copyright (c) 2002-2004, Dr. Edmund Weitz. All rights reserved.
;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions
Index: cl-ppcre/convert.lisp diff -u cl-ppcre/convert.lisp:1.1.1.1 cl-ppcre/convert.lisp:1.2 --- cl-ppcre/convert.lisp:1.1.1.1 Tue Jan 6 19:58:57 2004 +++ cl-ppcre/convert.lisp Thu Apr 22 14:53:13 2004 @@ -1,11 +1,11 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-PPCRE; Base: 10 -*- -;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/convert.lisp,v 1.1.1.1 2004/01/07 00:58:57 eweitz Exp $ +;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/convert.lisp,v 1.2 2004/04/22 18:53:13 eweitz Exp $
;;; Here the parse tree is converted into its internal representation ;;; using REGEX objects. At the same time some optimizations are ;;; already applied.
-;;; Copyright (c) 2002-2003, Dr. Edmund Weitz. All rights reserved. +;;; Copyright (c) 2002-2004, Dr. Edmund Weitz. All rights reserved.
;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions
Index: cl-ppcre/errors.lisp diff -u cl-ppcre/errors.lisp:1.1.1.1 cl-ppcre/errors.lisp:1.2 --- cl-ppcre/errors.lisp:1.1.1.1 Tue Jan 6 19:57:36 2004 +++ cl-ppcre/errors.lisp Thu Apr 22 14:53:13 2004 @@ -1,7 +1,7 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-PPCRE-LISP; Base: 10 -*- -;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/errors.lisp,v 1.1.1.1 2004/01/07 00:57:36 eweitz Exp $ +;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/errors.lisp,v 1.2 2004/04/22 18:53:13 eweitz Exp $
-;;; Copyright (c) 2002-2003, Dr. Edmund Weitz. All rights reserved. +;;; Copyright (c) 2002-2004, Dr. Edmund Weitz. All rights reserved.
;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions @@ -50,7 +50,19 @@ (simple-condition-format-control condition) (simple-condition-format-arguments condition) (ppcre-syntax-error-pos condition) - (ppcre-syntax-error-string condition))))) + (ppcre-syntax-error-string condition)))) + (:documentation "Signaled if CL-PPCRE's parser encounters an error +when trying to parse a regex string or to convert a parse tree into +its internal representation.")) + +(setf (documentation 'ppcre-syntax-error-string 'function) + "Returns the string the parser was parsing when the error was +encountered (or NIL if the error happened while trying to convert a +parse tree).") + +(setf (documentation 'ppcre-syntax-error-pos 'function) + "Returns the position within the string where the error occured +(or NIL if the error happened while trying to convert a parse tree")
(define-condition ppcre-invocation-error (ppcre-error) ()
Index: cl-ppcre/lexer.lisp diff -u cl-ppcre/lexer.lisp:1.1.1.1 cl-ppcre/lexer.lisp:1.2 --- cl-ppcre/lexer.lisp:1.1.1.1 Tue Jan 6 19:59:12 2004 +++ cl-ppcre/lexer.lisp Thu Apr 22 14:53:13 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-PPCRE; Base: 10 -*- -;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/lexer.lisp,v 1.1.1.1 2004/01/07 00:59:12 eweitz Exp $ +;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/lexer.lisp,v 1.2 2004/04/22 18:53:13 eweitz Exp $
;;; The lexer's responsibility is to convert the regex string into a ;;; sequence of tokens which are in turn consumed by the parser. @@ -9,7 +9,7 @@ ;;; has opened so far. (The latter is necessary for interpreting ;;; strings like "\10" correctly.)
-;;; Copyright (c) 2002-2003, Dr. Edmund Weitz. All rights reserved. +;;; Copyright (c) 2002-2004, Dr. Edmund Weitz. All rights reserved.
;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions @@ -165,7 +165,7 @@ while (and skip-char (char/= skip-char #))) finally (return skip-char)) - (signal-ppcre-syntax-error + (signal-ppcre-syntax-error* error-pos "Comment group not closed"))) (setq next-char (next-char-non-extended lexer))) @@ -282,7 +282,7 @@ (let ((code (logand #o377 (the fixnum (or number 0))))) (or (and (< code char-code-limit) (code-char code)) - (signal-ppcre-syntax-error + (signal-ppcre-syntax-error* error-pos "No character for hex-code ~X" number))))
Index: cl-ppcre/load.lisp diff -u cl-ppcre/load.lisp:1.1.1.1 cl-ppcre/load.lisp:1.2 --- cl-ppcre/load.lisp:1.1.1.1 Tue Jan 6 19:57:43 2004 +++ cl-ppcre/load.lisp Thu Apr 22 14:53:13 2004 @@ -1,7 +1,7 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*- -;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/load.lisp,v 1.1.1.1 2004/01/07 00:57:43 eweitz Exp $ +;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/load.lisp,v 1.2 2004/04/22 18:53:13 eweitz Exp $
-;;; Copyright (c) 2002-2003, Dr. Edmund Weitz. All rights reserved. +;;; Copyright (c) 2002-2004, Dr. Edmund Weitz. All rights reserved.
;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions
Index: cl-ppcre/optimize.lisp diff -u cl-ppcre/optimize.lisp:1.1.1.1 cl-ppcre/optimize.lisp:1.2 --- cl-ppcre/optimize.lisp:1.1.1.1 Tue Jan 6 19:59:16 2004 +++ cl-ppcre/optimize.lisp Thu Apr 22 14:53:13 2004 @@ -1,10 +1,10 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-PPCRE; Base: 10 -*- -;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/optimize.lisp,v 1.1.1.1 2004/01/07 00:59:16 eweitz Exp $ +;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/optimize.lisp,v 1.2 2004/04/22 18:53:13 eweitz Exp $
;;; This file contains optimizations which can be applied to converted ;;; parse trees.
-;;; Copyright (c) 2002-2003, Dr. Edmund Weitz. All rights reserved. +;;; Copyright (c) 2002-2004, Dr. Edmund Weitz. All rights reserved.
;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions @@ -580,7 +580,7 @@ (compute-min-rest (regex standalone) 0))
(defmethod compute-min-rest ((lookahead lookahead) current-min-rest) - (compute-min-rest (regex lookahead) current-min-rest) + (compute-min-rest (regex lookahead) 0) current-min-rest)
(defmethod compute-min-rest ((lookbehind lookbehind) current-min-rest)
Index: cl-ppcre/packages.lisp diff -u cl-ppcre/packages.lisp:1.1.1.1 cl-ppcre/packages.lisp:1.2 --- cl-ppcre/packages.lisp:1.1.1.1 Tue Jan 6 19:57:36 2004 +++ cl-ppcre/packages.lisp Thu Apr 22 14:53:13 2004 @@ -1,7 +1,7 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*- -;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/packages.lisp,v 1.1.1.1 2004/01/07 00:57:36 eweitz Exp $ +;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/packages.lisp,v 1.2 2004/04/22 18:53:13 eweitz Exp $
-;;; Copyright (c) 2002-2003, Dr. Edmund Weitz. All rights reserved. +;;; Copyright (c) 2002-2004, Dr. Edmund Weitz. All rights reserved.
;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions
Index: cl-ppcre/parser.lisp diff -u cl-ppcre/parser.lisp:1.1.1.1 cl-ppcre/parser.lisp:1.2 --- cl-ppcre/parser.lisp:1.1.1.1 Tue Jan 6 19:57:41 2004 +++ cl-ppcre/parser.lisp Thu Apr 22 14:53:13 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-PPCRE; Base: 10 -*- -;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/parser.lisp,v 1.1.1.1 2004/01/07 00:57:41 eweitz Exp $ +;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/parser.lisp,v 1.2 2004/04/22 18:53:13 eweitz Exp $
;;; The parser will - with the help of the lexer - parse a regex ;;; string and convert it into a "parse tree" (see docs for details @@ -7,7 +7,7 @@ ;;; illegal parse trees. It is assumed that the conversion process ;;; later on will track them down.
-;;; Copyright (c) 2002-2003, Dr. Edmund Weitz. All rights reserved. +;;; Copyright (c) 2002-2004, Dr. Edmund Weitz. All rights reserved.
;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions
Index: cl-ppcre/ppcre-tests.lisp diff -u cl-ppcre/ppcre-tests.lisp:1.1.1.1 cl-ppcre/ppcre-tests.lisp:1.2 --- cl-ppcre/ppcre-tests.lisp:1.1.1.1 Tue Jan 6 19:58:45 2004 +++ cl-ppcre/ppcre-tests.lisp Thu Apr 22 14:53:13 2004 @@ -1,7 +1,7 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-PPCRE-TEST; Base: 10 -*- -;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/ppcre-tests.lisp,v 1.1.1.1 2004/01/07 00:58:45 eweitz Exp $ +;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/ppcre-tests.lisp,v 1.2 2004/04/22 18:53:13 eweitz Exp $
-;;; Copyright (c) 2002-2003, Dr. Edmund Weitz. All rights reserved. +;;; Copyright (c) 2002-2004, Dr. Edmund Weitz. All rights reserved.
;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions
Index: cl-ppcre/regex-class.lisp diff -u cl-ppcre/regex-class.lisp:1.1.1.1 cl-ppcre/regex-class.lisp:1.2 --- cl-ppcre/regex-class.lisp:1.1.1.1 Tue Jan 6 19:58:47 2004 +++ cl-ppcre/regex-class.lisp Thu Apr 22 14:53:13 2004 @@ -1,11 +1,11 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-PPCRE; Base: 10 -*- -;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/regex-class.lisp,v 1.1.1.1 2004/01/07 00:58:47 eweitz Exp $ +;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/regex-class.lisp,v 1.2 2004/04/22 18:53:13 eweitz Exp $
;;; This file defines the REGEX class and some utility methods for ;;; this class. REGEX objects are used to represent the (transformed) ;;; parse trees internally
-;;; Copyright (c) 2002-2003, Dr. Edmund Weitz. All rights reserved. +;;; Copyright (c) 2002-2004, Dr. Edmund Weitz. All rights reserved.
;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions
Index: cl-ppcre/repetition-closures.lisp diff -u cl-ppcre/repetition-closures.lisp:1.1.1.1 cl-ppcre/repetition-closures.lisp:1.2 --- cl-ppcre/repetition-closures.lisp:1.1.1.1 Tue Jan 6 19:59:05 2004 +++ cl-ppcre/repetition-closures.lisp Thu Apr 22 14:53:13 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-PPCRE; Base: 10 -*- -;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/repetition-closures.lisp,v 1.1.1.1 2004/01/07 00:59:05 eweitz Exp $ +;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/repetition-closures.lisp,v 1.2 2004/04/22 18:53:13 eweitz Exp $
;;; This is actually a part of closures.lisp which we put into a ;;; separate file because it is rather complex. We only deal with @@ -7,7 +7,7 @@ ;;; rather crazy micro-optimizations which were introduced to be as ;;; competitive with Perl as possible in tight loops.
-;;; Copyright (c) 2002-2003, Dr. Edmund Weitz. All rights reserved. +;;; Copyright (c) 2002-2004, Dr. Edmund Weitz. All rights reserved.
;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions @@ -721,8 +721,8 @@ (declare (type fixnum start-pos)) (let ((next-pos (+ start-pos repetitions))) (declare (type fixnum next-pos)) - (or (<= next-pos *end-pos*) - (funcall next-fn next-pos)))) + (and (<= next-pos *end-pos*) + (funcall next-fn next-pos)))) ;; a dot which is not in single-line-mode - make sure we ;; don't match #\Newline (constant-repetition-constant-length-closure
Index: cl-ppcre/scanner.lisp diff -u cl-ppcre/scanner.lisp:1.1.1.1 cl-ppcre/scanner.lisp:1.2 --- cl-ppcre/scanner.lisp:1.1.1.1 Tue Jan 6 19:58:54 2004 +++ cl-ppcre/scanner.lisp Thu Apr 22 14:53:13 2004 @@ -1,10 +1,10 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-PPCRE; Base: 10 -*- -;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/scanner.lisp,v 1.1.1.1 2004/01/07 00:58:54 eweitz Exp $ +;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/scanner.lisp,v 1.2 2004/04/22 18:53:13 eweitz Exp $
;;; Here the scanner for the actual regex as well as utility scanners ;;; for the constant start and end strings are created.
-;;; Copyright (c) 2002-2003, Dr. Edmund Weitz. All rights reserved. +;;; Copyright (c) 2002-2004, Dr. Edmund Weitz. All rights reserved.
;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions @@ -37,7 +37,8 @@ (let ((char-compare (if case-insensitive-p 'char-equal 'char=))) `(lambda (start-pos) (declare (type fixnum start-pos)) - (if (> (the fixnum (+ start-pos m)) *end-pos*) + (if (or (minusp start-pos) + (> (the fixnum (+ start-pos m)) *end-pos*)) nil (loop named bmh-matcher for k of-type fixnum = (+ start-pos m -1) @@ -72,11 +73,12 @@ (return-from create-bmh-matcher (lambda (start-pos) (declare (type fixnum start-pos)) - (search pattern - *string* - :start2 start-pos - :end2 *end-pos* - :test test))))) + (and (not (minusp start-pos)) + (search pattern + *string* + :start2 start-pos + :end2 *end-pos* + :test test)))))) (let* ((m (length pattern)) (skip (make-array *regex-char-code-limit* :element-type 'fixnum
Index: cl-ppcre/specials.lisp diff -u cl-ppcre/specials.lisp:1.1.1.1 cl-ppcre/specials.lisp:1.2 --- cl-ppcre/specials.lisp:1.1.1.1 Tue Jan 6 19:58:47 2004 +++ cl-ppcre/specials.lisp Thu Apr 22 14:53:13 2004 @@ -1,9 +1,9 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-PPCRE; Base: 10 -*- -;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/specials.lisp,v 1.1.1.1 2004/01/07 00:58:47 eweitz Exp $ +;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/specials.lisp,v 1.2 2004/04/22 18:53:13 eweitz Exp $
;;; globally declared special variables
-;;; Copyright (c) 2002-2003, Dr. Edmund Weitz. All rights reserved. +;;; Copyright (c) 2002-2004, Dr. Edmund Weitz. All rights reserved.
;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions @@ -102,4 +102,25 @@ but large) Boyer-Moore-Horspool matchers.")
(defvar *allow-quoting* nil - "Whether the parser should support Perl's \Q and \E.") \ No newline at end of file + "Whether the parser should support Perl's \Q and \E.") + +(pushnew :cl-ppcre *features*) + +;; stuff for Nikodemus Siivola's HYPERDOC +;; see http://common-lisp.net/project/hyperdoc/ +;; and http://www.cliki.net/hyperdoc + +(defvar *hyperdoc-base-uri* "http://weitz.de/cl-ppcre/") + +(let ((exported-symbols-alist + (loop for symbol being the external-symbols of :cl-ppcre + collect (cons symbol + (concatenate 'string + "#" + (string-downcase symbol)))))) + (defun hyperdoc-lookup (symbol type) + (declare (ignore type)) + (cdr (assoc symbol + exported-symbols-alist + :test #'eq)))) + \ No newline at end of file
Index: cl-ppcre/util.lisp diff -u cl-ppcre/util.lisp:1.1.1.1 cl-ppcre/util.lisp:1.2 --- cl-ppcre/util.lisp:1.1.1.1 Tue Jan 6 19:59:06 2004 +++ cl-ppcre/util.lisp Thu Apr 22 14:53:13 2004 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-PPCRE; Base: 10 -*- -;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/util.lisp,v 1.1.1.1 2004/01/07 00:59:06 eweitz Exp $ +;;; $Header: /project/cl-ppcre/cvsroot/cl-ppcre/util.lisp,v 1.2 2004/04/22 18:53:13 eweitz Exp $
;;; Utility functions and constants dealing with the hash-tables ;;; we use to encode character classes @@ -7,7 +7,7 @@ ;;; Hash-tables are treated like sets, i.e. a character C is a member of the ;;; hash-table H iff (GETHASH C H) is true.
-;;; Copyright (c) 2002-2003, Dr. Edmund Weitz. All rights reserved. +;;; Copyright (c) 2002-2004, Dr. Edmund Weitz. All rights reserved.
;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions