In Grammars§
See primary documentation in context for Rules.
The only difference between the token
and rule
declarators is that the rule
declarator causes :sigspace
to go into effect for the Regex:
my token token-match { 'once' 'upon' 'a' 'time' } my rule rule-match { 'once' 'upon' 'a' 'time' } say so 'onceuponatime' ~~ &token-match; # OUTPUT: «True» say so 'once upon a time' ~~ &token-match; # OUTPUT: «False» say so 'onceuponatime' ~~ &rule-match; # OUTPUT: «False» say so 'once upon a time' ~~ &rule-match; # OUTPUT: «True»