Moritz Lenz wrote: > Martin Kjeldsen (via RT) wrote: >> # New Ticket Created by Martin Kjeldsen >> # Please include the string: [perl #61308] >> # in the subject line of all future correspondence about this issue. >> # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=61308 > >> >> >> When using rules at least with <ws> overwritten, the rule also captures >> whitespace. Please see attached file for example. > > You're right that there's a bug, but the real issue is that 'token ws { > ... }' isn't used by implicit <.ws> in rules yet: > > grammar A { > token ws { 'a' }; > rule b {x y}; > }; > > if 'xab' ~~ m/ ^ <A::b> $/ { > say "match"; > } else { > say "no match"; > } > # output: no match\n
The output is still "no match" for me, but the tests I've added to t/spec/S05-grammar/ws.t all pass, and they seem to test for exactly the same thing. Or maybe I'm too tired to figure it out right now... any ideas? Cheers, Moritz