From 0442d895fd1910ccef47b263c41ef29c522eeb38 Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Mon, 12 Aug 2024 20:43:43 +0200 Subject: parse: generalize amount-block --- cook/parse.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cook') 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))) -- cgit v1.2.3