From d405a221bde3c2bfbb8dbb91e2c164b1c2e695a4 Mon Sep 17 00:00:00 2001 From: Tim Siegel Date: Sun, 26 Apr 2020 03:40:27 -0400 Subject: [PATCH] put in , not It makes more sense to keep number as a token. The whitespace belongs in factor, which is already a rule and just needs to allow space in the repetitions. This is also better pedantically because it makes it clear to the reader (of the book) exactly where this whitespace is taking effect. --- misc/calc.raku | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/misc/calc.raku b/misc/calc.raku index 599b1ad..4a1d8cd 100644 --- a/misc/calc.raku +++ b/misc/calc.raku @@ -10,7 +10,7 @@ grammar Calculator { } rule factor { - * %% + * %% } token op1 { @@ -30,12 +30,9 @@ grammar Calculator { | '(' ')' } - rule number { + token number { \d+ } - # token number { - # \d+ - # } } class CalculatorActions {