summaryrefslogtreecommitdiff
path: root/cook
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2024-08-11 12:32:18 +0200
committerEkaitz Zarraga <ekaitz@elenq.tech>2024-08-11 12:32:18 +0200
commit3525165eeefe739f9978c3b41dee85fd4b826ef5 (patch)
tree0bc0aea9f3b9a09a61c50c219ed8a11d875b2076 /cook
parentc0f318ef59986451ee0844e5cec1f24f2a623f37 (diff)
Group whitespaces in one string
Diffstat (limited to 'cook')
-rw-r--r--cook/parse.scm3
1 files changed, 2 insertions, 1 deletions
diff --git a/cook/parse.scm b/cook/parse.scm
index b5f994d..a4ab940 100644
--- a/cook/parse.scm
+++ b/cook/parse.scm
@@ -87,7 +87,8 @@ https://github.com/cooklang/spec/blob/main/EBNF.md
(define-grammar cook
(nl ((: ,newline-chars)))
(empty-line ((: bol ,nl)))
- (whitespace ((+ ,char-set:whitespace)))
+ (whitespace ((=> x (+ ,char-set:whitespace))
+ (list->string x)))
(any-text-item ((: (=> c (+ ,any-text-chars)))
(list->string c)))