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:
Stas Boukarev
2016-12-27 19:33:27 +03:00
parent 0f6fe804f8
commit 0f295337d9

View File

@ -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 '(?'."