X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/1d087117402054e058fcd4dc23aa2a1bae2446e0..54fa70952116ba0eb0f95b31376c925ae3c6dad2:/src/parser/scanner-proto.lisp?ds=inline diff --git a/src/parser/scanner-proto.lisp b/src/parser/scanner-proto.lisp index d590d77..bd7e160 100644 --- a/src/parser/scanner-proto.lisp +++ b/src/parser/scanner-proto.lisp @@ -176,7 +176,7 @@ (export '(token-scanner token-type token-value)) (defclass token-scanner () - ((type :reader token-type) + ((%type :reader token-type) (value :reader token-value) (captures :initform 0 :type fixnum) (tail :initform nil :type (or token-scanner-place null)) @@ -206,7 +206,10 @@ ;; A place marker. (export '(token-scanner-place token-scanner-place-p)) -(defstruct token-scanner-place +(defstruct (token-scanner-place + (:constructor make-token-scanner-place + (&key scanner next type value line column + &aux (%type type)))) "A link in the chain of lookahead tokens; capturable as a place. If the scanner's place is captured, it starts to maintain a list of @@ -220,10 +223,12 @@ (scanner nil :type token-scanner :read-only t) (next nil :type (or token-scanner-place null)) - (type nil :read-only t) + (%type nil :read-only t) (value nil :read-only t) (line 1 :type (or fixnum null) :read-only t) (column 0 :type (or fixnum null) :read-only t)) +(define-access-wrapper token-scanner-place-type token-scanner-place-%type + :read-only t) ;; Protocol.