summaryrefslogtreecommitdiff
path: root/cook/parse.scm
diff options
context:
space:
mode:
Diffstat (limited to 'cook/parse.scm')
-rw-r--r--cook/parse.scm12
1 files changed, 11 insertions, 1 deletions
diff --git a/cook/parse.scm b/cook/parse.scm
index e162698..e53ce9f 100644
--- a/cook/parse.scm
+++ b/cook/parse.scm
@@ -56,6 +56,11 @@ https://github.com/cooklang/spec/blob/main/EBNF.md
comment?
(text comment-text))
+(define-record-type <note>
+ (make-note text)
+ note?
+ (text note-text))
+
(define-record-type <recipe>
(make-recipe metadata body)
recipe?
@@ -118,6 +123,11 @@ https://github.com/cooklang/spec/blob/main/EBNF.md
((: "[-" (=> c (* any)) "-]")
(make-comment (list->string c))))
+ (note-line ((: ">" (=> c (+ ,any-text-chars)) (or eos ,nl))
+ (string-trim (list->string c))))
+ (note ((=> n (+ ,note-line))
+ (make-note (string-join n " "))))
+
(word ((=> w (+ ,word-chars))
w))
(unit ((=> u ,(parse-map-substring
@@ -189,7 +199,7 @@ https://github.com/cooklang/spec/blob/main/EBNF.md
(* ,whitespace) eol)
(make-metadata-line k v)))
- (element ((or ,metadata ,comment ,step)))
+ (element ((or ,metadata ,comment ,note ,step)))
(recipe ((=> els
(* (: ,element ,(parse-ignore