X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/1d8cc67a3f4ded443f5efc673a616883cbae9c50..9ec578d9fe450b7e7f9030dc9d930185593aa991:/src/parser/scanner-charbuf-impl.lisp diff --git a/src/parser/scanner-charbuf-impl.lisp b/src/parser/scanner-charbuf-impl.lisp index 86dc999..272c7ed 100644 --- a/src/parser/scanner-charbuf-impl.lisp +++ b/src/parser/scanner-charbuf-impl.lisp @@ -67,11 +67,18 @@ We remember the buffer-chain link, so that we can retrace our steps up to the present. We also need the index at which we continue reading characters; and the line and column numbers to resume from." + (scanner nil :type charbuf-scanner :read-only t) (link nil :type charbuf-chain-link :read-only t) (index 0 :type charbuf-index :read-only t) (line 0 :type fixnum :read-only t) (column 0 :type fixnum :read-only t)) +(defmethod file-location ((place charbuf-scanner-place)) + (make-file-location (scanner-filename + (charbuf-scanner-place-scanner place)) + (charbuf-scanner-place-line place) + (charbuf-scanner-place-column place))) + ;;;-------------------------------------------------------------------------- ;;; Main class. @@ -317,7 +324,7 @@ (incf captures) (unless tail (setf tail (make-charbuf-chain-link :buf buf :size size))) - (make-charbuf-scanner-place :link tail :index index + (make-charbuf-scanner-place :scanner scanner :link tail :index index :line line :column column))) (defmethod scanner-restore-place ((scanner charbuf-scanner) place) @@ -367,7 +374,8 @@ (let* ((slices nil) (place-b (or place-b (with-slots (index tail) scanner - (make-charbuf-scanner-place :link tail + (make-charbuf-scanner-place :scanner scanner + :link tail :index index)))) (last-link (charbuf-scanner-place-link place-b))) (flet ((bad ()