src/parser/: Allow parsers to commit to a parse while peeking.
[sod] / src / parser / scanner-proto.lisp
index 8f27f89..c6236c5 100644 (file)
       `(let ((,place (scanner-capture-place ,scanner)))
         ,@decls
         (unwind-protect (progn ,@body)
-          (scanner-release-place ,scanner ,place))))))
+          (when ,place (scanner-release-place ,scanner ,place)))))))
 
 ;;;--------------------------------------------------------------------------
 ;;; Character scanner protocol.