From 1d087117402054e058fcd4dc23aa2a1bae2446e0 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 15 Aug 2015 16:19:47 +0100 Subject: [PATCH] src/parser/scanner-proto.lisp: Reorder declarations. The `token-scanner' and `token-scanner-place' objects refer to each other recursively through their slot types. SBCL's loader objects to this if `token-scanner-place' -- a structure type -- is first. Reorder them so that `token-scanner' -- a CLOS class -- is first, because that seems to work better. --- src/parser/scanner-proto.lisp | 44 +++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/parser/scanner-proto.lisp b/src/parser/scanner-proto.lisp index a852bdb..d590d77 100644 --- a/src/parser/scanner-proto.lisp +++ b/src/parser/scanner-proto.lisp @@ -172,28 +172,6 @@ ;;;-------------------------------------------------------------------------- ;;; Token scanner protocol. -;; A place marker. - -(export '(token-scanner-place token-scanner-place-p)) -(defstruct token-scanner-place - "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 - lookahead tokens. The list contains internal links -- it works out - slightly easier that way. This is basically a simpler version of the - charbuf scanner (q.v.); most significantly, the chain links here do double - duty as place markers. - - The details of this structure are not a defined part of the token scanner - protocol." - - (scanner nil :type token-scanner :read-only t) - (next nil :type (or token-scanner-place null)) - (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)) - ;; The token scanner base class and parser context. (export '(token-scanner token-type token-value)) @@ -225,6 +203,28 @@ (:documentation "A parser context for a richer token-based scanners.")) +;; A place marker. + +(export '(token-scanner-place token-scanner-place-p)) +(defstruct token-scanner-place + "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 + lookahead tokens. The list contains internal links -- it works out + slightly easier that way. This is basically a simpler version of the + charbuf scanner (q.v.); most significantly, the chain links here do double + duty as place markers. + + The details of this structure are not a defined part of the token scanner + protocol." + + (scanner nil :type token-scanner :read-only t) + (next nil :type (or token-scanner-place null)) + (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)) + ;; Protocol. (export 'scanner-token) -- 2.11.0