Report a syntax error on "(?<".
Instead of failing due to NIL not being a character in a call to ALPHA-CHAR-P.
This commit is contained in:
12
lexer.lisp
12
lexer.lisp
@ -672,18 +672,20 @@ closing #\> will also be consumed."
|
||||
;; might be a look-behind assertion or a named group, so
|
||||
;; check next character
|
||||
(let ((next-char (next-char-non-extended lexer)))
|
||||
(if (alpha-char-p next-char)
|
||||
(progn
|
||||
(cond ((and next-char
|
||||
(alpha-char-p next-char))
|
||||
;; we have encountered a named group
|
||||
;; are we supporting register naming?
|
||||
(unless *allow-named-registers*
|
||||
(signal-syntax-error* (1- (lexer-pos lexer))
|
||||
"Character '~A' may not follow '(?<'."
|
||||
next-char))
|
||||
"Character '~A' may not follow '(?<' (because ~a = NIL)"
|
||||
next-char
|
||||
'*allow-named-registers*))
|
||||
;; put the letter back
|
||||
(decf (lexer-pos lexer))
|
||||
;; named group
|
||||
:open-paren-less-letter)
|
||||
(t
|
||||
(case next-char
|
||||
((#\=)
|
||||
;; positive look-behind
|
||||
@ -702,7 +704,7 @@ closing #\> will also be consumed."
|
||||
;; also syntax error
|
||||
(signal-syntax-error* (1- (lexer-pos lexer))
|
||||
"Character '~A' may not follow '(?<'."
|
||||
next-char ))))))
|
||||
next-char )))))))
|
||||
(otherwise
|
||||
(signal-syntax-error* (1- (lexer-pos lexer))
|
||||
"Character '~A' may not follow '(?'."
|
||||
|
||||
Reference in New Issue
Block a user