Patrik (>):
> The following program works as I expect:
>
> grammar g {
> rule TOP {[a| ]+}
> rule ws {<blank>+}
> }
> g.parse('a a');
> say "'$/'";
>
> gives me 'a a',
>
> but changing [a| ] into [ |a] gives me
>
> 'a'
>
> I suspect this is a problem in the rakudo implementation.
Yes, but perhaps not as you expect. See "Nothing is illegal" at
<http://perlcabal.org/syn/S05.html#Nothing_is_illegal>.
In essence, /[ | a]/ should mean (and does in Rakudo) /a/, whereas /[
a | ]/ should be a compile-time error.
// Carl