Patrik (>): > Your link seems to specifiy how empty patterns are illegal. However, > reading the :sigspace definition, I assume that rule {[ |a]+} is > eqivalent to token {[<.ws>|a]+}, which not contains any empty pattern.
I find nothing in the spec that addresses this case specifically. (Though I might have simply missed it.) However, I expect *any* alternations on the form /[ |a]/ to simplify to just /[a]/, so I don't agree with your equivalence above. More generally, nowhere in Perl 6 regexes does a regex (or alternation alternative, or capture, or group, etc) containing *only* whitespace correspond to <.ws> -- instead, it's illegal. The fact that Rakudo sometimes erroneously accepts such regexes helps confuse matters a bit. The fact that /[ |a]/ is a legal special case meaning /[a]/ helps confuse things a bit further. // Carl