summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2024-08-11 21:07:06 +0200
committerEkaitz Zarraga <ekaitz@elenq.tech>2024-08-11 21:07:06 +0200
commit4ebc2d7b6ea132071ff892eaa46028f5a1bd8840 (patch)
tree45f0b42d6fce4e29dd90edde12121f53a8a6f110
parentee37adcf244c4c20c2eb98e2d3538378aa02ac13 (diff)
Make comments work, but break other things
-rw-r--r--cook/parse.scm18
1 files changed, 10 insertions, 8 deletions
diff --git a/cook/parse.scm b/cook/parse.scm
index 2570f61..05b3a2a 100644
--- a/cook/parse.scm
+++ b/cook/parse.scm
@@ -95,10 +95,8 @@ https://github.com/cooklang/spec/blob/main/EBNF.md
(any-text-item ((: (=> c (+ ,any-text-chars)))
(list->string c)))
- (text-item ((: (=> c (+ ,text-chars)))
- (list->string c)))
- (comment ((: "--" (=> c (+ ,any-text-chars)) ,nl)
+ (comment ((: "--" (=> c (+ ,any-text-chars)) (or eos ,nl))
(make-comment (list->string c)))
((: "[-" (=> c (* any)) "-]")
(make-comment (list->string c))))
@@ -136,13 +134,17 @@ https://github.com/cooklang/spec/blob/main/EBNF.md
(ingredient ((: "@" (=> c ,component))
(component->ingredient c)))
+ (text-item ((=> t (+ (or ,comment
+ ,ingredient
+ ,cookware
+ ,timer
+ ,any-text-chars)))
+ t))
+
(step-line ((: (? ,whitespace)
- (=> s (+ (or ,ingredient
- ,cookware
- ,timer
- ,text-item)))
+ (=> s (+ ,text-item))
(? ,nl))
- s))
+ (concatenate s)))
(step ((: (=> s ,step-line) (=> ns (* ,step-line)))
(make-step (concatenate (append (list s) ns)))))