diff options
Diffstat (limited to 'cook')
-rw-r--r-- | cook/parse.scm | 18 |
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))))) |