summaryrefslogtreecommitdiff
path: root/cook
diff options
context:
space:
mode:
Diffstat (limited to 'cook')
-rw-r--r--cook/debug.sld2
-rw-r--r--cook/parse-internals.sld2
-rw-r--r--cook/parse.scm9
-rw-r--r--cook/parse.sld2
4 files changed, 13 insertions, 2 deletions
diff --git a/cook/debug.sld b/cook/debug.sld
index 9ae9638..6b7ef33 100644
--- a/cook/debug.sld
+++ b/cook/debug.sld
@@ -10,6 +10,8 @@
(cond
((amount? y)
(list 'amount (amount-quantity y) (amount-unit y)))
+ ((comment? y)
+ (list 'comment (comment-text y)))
((component? y)
(list 'component (component-name y) (cook->list (component-amount y))))
((cookware? y)
diff --git a/cook/parse-internals.sld b/cook/parse-internals.sld
index 5b8df2e..99160fd 100644
--- a/cook/parse-internals.sld
+++ b/cook/parse-internals.sld
@@ -28,6 +28,8 @@
metadata-line-value
step?
step-elements
+ comment?
+ comment-text
parse-cook
nl
whitespace
diff --git a/cook/parse.scm b/cook/parse.scm
index 33bf3b0..2cc604b 100644
--- a/cook/parse.scm
+++ b/cook/parse.scm
@@ -51,6 +51,11 @@ https://github.com/cooklang/spec/blob/main/EBNF.md
step?
(elements step-elements))
+(define-record-type <comment>
+ (make-comment text)
+ comment?
+ (text comment-text))
+
(define (metadata-line-list->hash-table meta-lines)
(let ((metadata (make-hash-table)))
(for-each (lambda (line)
@@ -86,9 +91,9 @@ https://github.com/cooklang/spec/blob/main/EBNF.md
(list->string c)))
(comment ((: "--" (=> c (+ ,any-text-chars)) ,nl)
- (list->string c))
+ (make-comment (list->string c)))
((: "[-" (=> c (* any)) "-]")
- (list->string c)))
+ (make-comment (list->string c))))
(word ((=> w (+ ,word-chars))
(list->string w)))
diff --git a/cook/parse.sld b/cook/parse.sld
index 29742b0..6a92d1d 100644
--- a/cook/parse.sld
+++ b/cook/parse.sld
@@ -20,6 +20,8 @@
cookware?
cookware-name
cookware-amount
+ comment?
+ comment-text
step?
step-elements
parse-cook)