From d018d6d87c7a2c3458348f775319b6f9c4a88380 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Thu, 22 Aug 2019 13:00:18 +0100 Subject: [PATCH 1/1] src/module-parse.lisp (code): Prepare for an additional variant. Some more minor refactoring: pull NAME [CONSTRAINTS] `{' FRAGMENT `}' into an `or' subitem. --- src/module-parse.lisp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/module-parse.lisp b/src/module-parse.lisp index fb4903b..f025e37 100644 --- a/src/module-parse.lisp +++ b/src/module-parse.lisp @@ -80,16 +80,16 @@ (parse (seq ("code" (reason (must (kw))) (nil (must #\:)) - (name (must (item))) - (constraints (? (constraints))) - (fragment (fragment))) - (when name - (add-to-module *module* - (make-instance 'code-fragment-item - :fragment fragment - :constraints constraints - :reason reason - :name name)))))))) + (item (or (seq ((name (must (item))) + (constraints (? (constraints))) + (fragment (fragment))) + (and name + (make-instance 'code-fragment-item + :reason reason + :constraints constraints + :name name + :fragment fragment)))))) + (when item (add-to-module *module* item))))))) ;;; External files. -- 2.11.0