chiark
/
gitweb
/
~mdw
/
sod
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
src/lexer-{proto,impl}.lisp: Add explicit recovery action to `error'.
[sod]
/
src
/
lexer-proto.lisp
diff --git
a/src/lexer-proto.lisp
b/src/lexer-proto.lisp
index 60235ff7f0934f75c00746ca05e3b8413355cd3b..a811298759a08868bdb4c8c2be3ef2093f0a7fe5 100644
(file)
--- a/
src/lexer-proto.lisp
+++ b/
src/lexer-proto.lisp
@@
-129,7
+129,7
@@
(defparse skip-until (:context (context token-scanner-context)
(export 'error)
(defparse error (:context (context token-scanner-context)
(&key ignore-unconsumed force-progress)
(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
"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
+148,8
@@
(defparse error (:context (context token-scanner-context)
(parser () ,sub)
(parser () ,recover)
:ignore-unconsumed ,ignore-unconsumed
(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)
(export 'must)
(defparse must (:context (context token-scanner-context)