chiark / gitweb /
lib/keyword.c (kw_parseempty): Use correct variable scanning `kwval' list.
[sod] / src / parser / scanner-proto.lisp
index 8f27f895ea084c115629e549a66aee68665f1389..aed4c9f3bd0216ce90dba3c07a36d6f7b8707a92 100644 (file)
@@ -74,7 +74,7 @@ (defgeneric scanner-capture-place (scanner)
   (:documentation
    "Capture the SCANNER's current place and return it.")
   (:method (scanner)
-    (error "Scanner ~S doesn't support rewinding." scanner)))
+    (error "Scanner ~S doesn't support rewinding" scanner)))
 
 (export 'scanner-restore-place)
 (defgeneric scanner-restore-place (scanner place)
@@ -104,7 +104,7 @@ (defmacro with-scanner-place ((place scanner) &body body)
       `(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.
@@ -157,6 +157,7 @@ (defgeneric scanner-column (scanner)
   (:documentation "Return the SCANNER's current column number.")
   (:method (scanner) nil))
 
+(export 'scanner-file-location)
 (defun scanner-file-location (scanner)
   "Capture the current location of the SCANNER.