On Dec 13, 2008, at 3:44 AM, 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

Thank you for your report,
Moritz


In which case, the root cause may be the same as
[perl #57864] Calling a token "text", "null" or "ws" in Rakudo makes matching fail

Chris

Reply via email to