X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/sod/blobdiff_plain/1c2db39a35b4efe99594b2a53737d4f0971d01d8..b5911ce8da34bfdd5c4515b44fd2efce7c9c233f:/src/lexer-impl.lisp diff --git a/src/lexer-impl.lisp b/src/lexer-impl.lisp index 1686179..de76371 100644 --- a/src/lexer-impl.lisp +++ b/src/lexer-impl.lisp @@ -67,7 +67,7 @@ (defun %skip-until (scanner token-types (scanner-step scanner))) (defun parse-error-recover (scanner parser recover - &key ignore-unconsumed force-progress) + &key ignore-unconsumed force-progress action) "This is the implementation of the `error' parser." (multiple-value-bind (result win consumedp) (funcall parser) (cond ((or win @@ -93,6 +93,7 @@ (defun parse-error-recover (scanner parser recover ;; simply to propagate the current failure back to the caller, but ;; we handled that case above. (syntax-error scanner result) + (when action (funcall action)) (when (and force-progress (not consumedp)) (scanner-step scanner)) (funcall recover)))))