Not sure what the idea was. It seems to control printing the location
as part of the message, but the error printing machinery takes care of
doing that anyway; and even so, it seems to hang off this flag.
Kill it, and the redundant printing of the location.
\end{describe}
\begin{describe}{fun}
\end{describe}
\begin{describe}{fun}
- {lexer-error @<char-scanner> @<expected> @<consumed-flag>}
+ {lexer-error @<char-scanner> @<expected>}
\end{describe}
\begin{describe}{parseform}
\end{describe}
\begin{describe}{parseform}
(values end-chars nil nil)))
(return (values it t t)))
(:eof
(values end-chars nil nil)))
(return (values it t t)))
(:eof
- (lexer-error char-scanner '(:any) cp)
+ (lexer-error char-scanner '(:any))
(return (values (result) t t)))
;; Opening and closing brackets. Opening brackets push things
(return (values (result) t t)))
;; Opening and closing brackets. Opening brackets push things
;; This really shouldn't be able to happen.
(t
(assert cp)
;; This really shouldn't be able to happen.
(t
(assert cp)
- (lexer-error char-scanner exp cp)))))))))
+ (lexer-error char-scanner exp)))))))))
(export 'parse-delimited-fragment)
(defun parse-delimited-fragment (scanner begin end &key keep-end)
(export 'parse-delimited-fragment)
(defun parse-delimited-fragment (scanner begin end &key keep-end)
(cond-parse (:consumedp cp :expected exp)
((satisfies whitespace-char-p) (parse :whitespace))
((scan-comment char-scanner))
(cond-parse (:consumedp cp :expected exp)
((satisfies whitespace-char-p) (parse :whitespace))
((scan-comment char-scanner))
- (t (if cp (lexer-error char-scanner exp cp) (return)))))
+ (t (if cp (lexer-error char-scanner exp) (return)))))
;; Now parse something.
(cond-parse (:consumedp cp :expected exp)
;; Now parse something.
(cond-parse (:consumedp cp :expected exp)
;; must make progress on every call.
(t
(assert cp)
;; must make progress on every call.
(t
(assert cp)
- (lexer-error char-scanner exp cp)
+ (lexer-error char-scanner exp)
(scanner-token scanner)))))))
;;;----- That's all, folks --------------------------------------------------
(scanner-token scanner)))))))
;;;----- That's all, folks --------------------------------------------------
(show-token (token-type scanner) (token-value scanner)))))
(export 'lexer-error)
(show-token (token-type scanner) (token-value scanner)))))
(export 'lexer-error)
-(defun lexer-error (char-scanner expected consumedp)
+(defun lexer-error (char-scanner expected)
"Signal a continuable lexical error."
(cerror* "Lexical error: ~
expected ~{~#[<bug>~;~A~;~A or ~A~:;~A, ~]~} ~
"Signal a continuable lexical error."
(cerror* "Lexical error: ~
expected ~{~#[<bug>~;~A~;~A or ~A~:;~A, ~]~} ~
- but found ~/sod::show-char/~
- ~@[ at ~A~]"
+ but found ~/sod::show-char/"
(mapcar (lambda (exp)
(typecase exp
(character (format nil "~/sod::show-char/" exp))
(mapcar (lambda (exp)
(typecase exp
(character (format nil "~/sod::show-char/" exp))
(t (format nil "<? ~S>" exp))))
expected)
(and (not (scanner-at-eof-p char-scanner))
(t (format nil "<? ~S>" exp))))
expected)
(and (not (scanner-at-eof-p char-scanner))
- (scanner-current-char char-scanner))
- (and consumedp (file-location char-scanner))))
+ (scanner-current-char char-scanner))))
(export 'skip-until)
(defparse skip-until (:context (context token-scanner-context)
(export 'skip-until)
(defparse skip-until (:context (context token-scanner-context)