http://qs321.pair.com?node_id=843877

rir has asked for the wisdom of the Perl Monks concerning the following question:

In the below, I don't see why the x matches differently from the * ?
#!/home/rir/rakudo/parrot_install/bin/perl6 use v6; grammar Calc { rule TOP { <term> <op> <term> } # rule TOP { <term>\s?<op>\s?<term> } # a fix token term { \d+(\.\d*)? } token op { '*' | 'x' } } my @t = ( [ 44, " 8.8 * 5.0 " ], [ 44, " 8.8 x 5.0 " ], [ 44, " 8.8*5.0 " ], [ 44, " 8.8x5.0 " ], # no match ); for @t -> $i { my $m = Calc.parse( $i[1]); print $m ?? " " !! "no"; say " match: $i[1]" }
Be well,
rir