From 9a4e880142da35dd14f7a655c216791fca262730 Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Mon, 12 Aug 2024 23:30:36 +0200 Subject: parse: Don't create amount if it's only whitespace --- cook/parse.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cook') 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))) -- cgit v1.2.3