chiark / gitweb /
lib/keyword.c (kw_parseempty): Use correct variable scanning `kwval' list.
[sod] / src / lexer-proto.lisp
index 60235ff7f0934f75c00746ca05e3b8413355cd3b..a237a92778634474ffb72c92d3c081e03918c9ae 100644 (file)
@@ -65,6 +65,14 @@ (define-condition syntax-error (parser-error base-syntax-error)
                              (:char "<character-literal>")
                              (:eof "<end-of-file>")
                              (:ellipsis "`...'")
+                             (:shl "`<<'")
+                             (:shr "`>>'")
+                             (:eq "`=='")
+                             (:ne "`!='")
+                             (:le "`<='")
+                             (:ge "`>='")
+                             (:and "`&&'")
+                             (:or "`||'")
                              (t (format nil "<? ~S~@[ ~S~]>" type value)))))
                      (show-expected (thing)
                        (acond ((gethash thing *indicator-map*) it)
@@ -129,7 +137,7 @@ (defparse skip-until (:context (context token-scanner-context)
 (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 @@ (defparse error (:context (context token-scanner-context)
                        (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)