summaryrefslogtreecommitdiff
path: root/cook
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2024-08-12 23:30:36 +0200
committerEkaitz Zarraga <ekaitz@elenq.tech>2024-08-12 23:31:07 +0200
commit9a4e880142da35dd14f7a655c216791fca262730 (patch)
treebfc19c5f934086e65d7a2e789015af69c1e91a25 /cook
parentf44e4dc849de4c6d5f64d4fac812e424e4c193c2 (diff)
parse: Don't create amount if it's only whitespace
Diffstat (limited to 'cook')
-rw-r--r--cook/parse.scm4
1 files changed, 3 insertions, 1 deletions
diff --git a/cook/parse.scm b/cook/parse.scm
index 46313b0..ee4cdf2 100644
--- a/cook/parse.scm
+++ b/cook/parse.scm
@@ -134,7 +134,9 @@ https://github.com/cooklang/spec/blob/main/EBNF.md
(meta-key ((=> k (+ ,metadata-chars))
(list->string k)))
- (amount ((: (=> q ,quantity) "%" (=> u ,unit))
+ (amount ((=> q ,whitespace)
+ #f)
+ ((: (=> q ,quantity) "%" (=> u ,unit))
(make-amount q u))
((=> q ,quantity)
(make-amount q #f)))