summaryrefslogtreecommitdiff
path: root/cook
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2024-08-12 20:43:43 +0200
committerEkaitz Zarraga <ekaitz@elenq.tech>2024-08-12 20:43:43 +0200
commit0442d895fd1910ccef47b263c41ef29c522eeb38 (patch)
tree6466c755cd29535335d76dc10eae415f04e89754 /cook
parent59895c92cd156fdbfa685a9da78f535ab0595065 (diff)
parse: generalize amount-block
Diffstat (limited to 'cook')
-rw-r--r--cook/parse.scm6
1 files changed, 4 insertions, 2 deletions
diff --git a/cook/parse.scm b/cook/parse.scm
index 2ccc4a6..57c5178 100644
--- a/cook/parse.scm
+++ b/cook/parse.scm
@@ -132,14 +132,16 @@ https://github.com/cooklang/spec/blob/main/EBNF.md
((=> q ,quantity)
(make-amount q #f)))
- (no-word-component ((: "{" (? (=> a ,amount)) "}")
+ (amount-block ((: "{" (? (=> a ,amount)) "}")
+ a))
+ (no-word-component ((: (=> a ,amount-block))
(make-component #f a)))
(component-word ((=> w (+ ,component-word-chars))
(list->string w)))
(component ((: (=> cw ,component-word)
(? (: (=> cc (* ,component-chars))
- "{" (? (=> a ,amount)) "}")))
+ (=> a ,amount-block))))
(make-component
(string-append cw (if cc (list->string cc) ""))
a)))