X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/sod/blobdiff_plain/b8c698eeb25ff564145079e4310b0bd71f84155b..refs/heads/mdw/progfmt:/src/parser/scanner-proto.lisp diff --git a/src/parser/scanner-proto.lisp b/src/parser/scanner-proto.lisp index ea41ad6..aed4c9f 100644 --- a/src/parser/scanner-proto.lisp +++ b/src/parser/scanner-proto.lisp @@ -7,7 +7,7 @@ ;;;----- Licensing notice --------------------------------------------------- ;;; -;;; This file is part of the Sensble Object Design, an object system for C. +;;; This file is part of the Sensible Object Design, an object system for C. ;;; ;;; SOD is free software; you can redistribute it and/or modify ;;; it under the terms of the GNU General Public License as published by @@ -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.