Moritz Lenz via RT (09:23 2008-12-14):
> 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
> 
> Thank you for your report,
> Moritz
> 

Hi Moritz,

you're right, I can't get your example to work. But I think you meant

if 'xay' ~~ m/ ^ <A::b> $/ { # y instead of b in string

and shouldn't it be rule b {'x' 'y'}; or doesn't that matter (I don't know).

But no matter it still doesn't work for some reason.

But more importantly if the whole problem is the <ws> is not overwritten I 
don't 
understand why my example matches, but doesn't match if I remove the <ws> 
token.  
Surely <ws> shouldn't default match C style comments.

Martin

Reply via email to