From: Mark Wooding Date: Thu, 22 Aug 2019 11:58:53 +0000 (+0100) Subject: src/module-parse.lisp (code): Hoist complex sub-items out of main parser. X-Git-Url: https://git.distorted.org.uk/~mdw/sod/commitdiff_plain/66c609241dd2783c53e6bdbf2dc80c528feaeef7 src/module-parse.lisp (code): Hoist complex sub-items out of main parser. --- diff --git a/src/module-parse.lisp b/src/module-parse.lisp index fed98f8..fb4903b 100644 --- a/src/module-parse.lisp +++ b/src/module-parse.lisp @@ -64,23 +64,25 @@ (item () (parse (or (kw) (seq (#\( (names (list (:min 1) (kw))) #\)) - names))))) + names)))) + (constraints () + (parse (seq (#\[ + (constraints + (list () + (list (:min 1) + (error (:ignore-unconsumed t) (item) + (skip-until () :id #\( #\, #\]))) + #\,)) + #\]) + constraints))) + (fragment () + (parse-delimited-fragment scanner #\{ #\}))) (parse (seq ("code" (reason (must (kw))) (nil (must #\:)) (name (must (item))) - (constraints (? (seq (#\[ - (constraints - (list () - (list (:min 1) - (error (:ignore-unconsumed t) - (item) - (skip-until () - :id #\( #\, #\]))) - #\,)) - #\]) - constraints))) - (fragment (parse-delimited-fragment scanner #\{ #\}))) + (constraints (? (constraints))) + (fragment (fragment))) (when name (add-to-module *module* (make-instance 'code-fragment-item