X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/1c2db39a35b4efe99594b2a53737d4f0971d01d8..12949379840101e2d65883f29c5e8f0f6de49e9c:/src/lexer-proto.lisp diff --git a/src/lexer-proto.lisp b/src/lexer-proto.lisp index 60235ff..a237a92 100644 --- a/src/lexer-proto.lisp +++ b/src/lexer-proto.lisp @@ -65,6 +65,14 @@ (:char "") (:eof "") (:ellipsis "`...'") + (:shl "`<<'") + (:shr "`>>'") + (:eq "`=='") + (:ne "`!='") + (:le "`<='") + (:ge "`>='") + (:and "`&&'") + (:or "`||'") (t (format nil "" type value))))) (show-expected (thing) (acond ((gethash thing *indicator-map*) it) @@ -129,7 +137,7 @@ (export 'error) (defparse error (:context (context token-scanner-context) (&key ignore-unconsumed force-progress) - sub &optional (recover t)) + sub &optional (recover t) &body body) "Try to parse SUB; if it fails then report an error, and parse RECOVER. This is the main way to recover from errors and continue parsing. Even @@ -148,7 +156,8 @@ (parser () ,sub) (parser () ,recover) :ignore-unconsumed ,ignore-unconsumed - :force-progress ,force-progress)) + :force-progress ,force-progress + :action ,(and body `(lambda () ,@body)))) (export 'must) (defparse must (:context (context token-scanner-context)