chiark
/
gitweb
/
~mdw
/
sod
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
40f2456
)
src/module-parse.lisp (code): Hoist complex sub-items out of main parser.
author
Mark Wooding
<mdw@distorted.org.uk>
Thu, 22 Aug 2019 11:58:53 +0000
(12:58 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Thu, 22 Aug 2019 12:12:02 +0000
(13:12 +0100)
src/module-parse.lisp
patch
|
blob
|
blame
|
history
diff --git
a/src/module-parse.lisp
b/src/module-parse.lisp
index fed98f80381fab3b2c3c7b53e7699c53f2669177..fb4903b4f8175cab052d2105bbc5692327f19301 100644
(file)
--- a/
src/module-parse.lisp
+++ b/
src/module-parse.lisp
@@
-64,23
+64,25
@@
(define-pluggable-parser module code (scanner pset)
(item ()
(parse (or (kw)
(seq (#\( (names (list (:min 1) (kw))) #\))
(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)))
(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
(when name
(add-to-module *module*
(make-instance 'code-fragment-item