From b6e934250c4b7b74201984f74392a2ce510e055d Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Sun, 11 Aug 2024 00:31:17 +0200 Subject: Also mark comments --- cook/parse.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'cook/parse.scm') 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 + (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))) -- cgit v1.2.3