# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #113590]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=113590 >


<adu> I can't track this bug
<adu> omg, I think I found the bug
<adu> rel_op:sym«<=» is not matching '<='
<adu> why?
<adu> rel_op:sym<!=> matches '!=' fine
<pmichaud> adu: gist?
<adu> http://pastebin.com/raw.php?i=FcAiMAU2
<adu> pmichaud: masak: yes
<adu> r: my grammar binop { rule TOP { <rel_op> }; proto token rel_op
{*}; token rel_op:sym<!=> { <sym> }; }; say binop.parse('!=')
<p6eval> rakudo b12854: OUTPUT«q[!=]␤ rel_op => q[!=]␤  sym => q[!=]␤␤»
<adu> (showing success)
<adu> r: my grammar binop { rule TOP { <rel_op> }; proto token rel_op
{*}; token rel_op:sym«<=» { <sym> }; }; say binop.parse('<=')
<p6eval> rakudo b12854: OUTPUT«#<failed match>␤»
<pmichaud> r: my grammar binop { proto token rel_op {*}; my $x = token
rel_op:sym«!=» { <sym> };  say $x; }
<p6eval> rakudo b12854: OUTPUT«rel_op:sym«!=»␤»
<pmichaud> ...that's the problem.  The regex engine expects those «'s
to be converted to single angles.
* masak submits rakudobug
<pmichaud> in Actions.pm
<pmichaud>           { if $<deflongname> { %*RX<name> :=
$<deflongname>[0].Str } }
<pmichaud> is likely the culprit.
<pmichaud> It needs to normalize the name of protoregex candidates.
<adu> hmm
<pmichaud> adu: in the meantime, you can do
<pmichaud> r: my grammar binop { rule TOP { <rel_op> }; proto token
rel_op {*}; token rel_op:sym<le> { '<=' }; }; say binop.parse('<=');
<p6eval> rakudo b12854: OUTPUT«q[<=]␤ rel_op => q[<=]␤␤»
<adu> oh ok, that works

Reply via email to