Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #111286] [BUG] Name capture happens in the presence of a quantifier but not in its absence in Rakudo

0 views
Skip to first unread message

Carl Mäsak

unread,
Feb 22, 2012, 8:05:58 AM2/22/12
to bugs-bi...@rt.perl.org
# New Ticket Created by "Carl Mäsak"
# Please include the string: [perl #111286]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=111286 >


<cognominal> nom: (grammar { token TOP { <a>? $<b>='b' }; token a {
a } }).parse: 'ab'; say $/<b>.keys;
<p6eval> nom 4130f6: OUTPUT«a␤»
<cognominal> nom: (grammar { token TOP { <a> $<b>='b' }; token a {
a } }).parse: 'ab'; say $/<b>.keys;
<p6eval> nom 4130f6: OUTPUT«␤»
<cognominal> jnthn, this does not make any sense to me that $/<b>.keys
returns anything different than a void Parcel
<cognominal> should I file a bug?
<moritz> nom: (grammar { token TOP { <a> $<b>='b' }; token a { a }
}).parse: 'ab'; say $/<b>.keys.WHAT;
<p6eval> nom 4130f6: OUTPUT«List()␤»
<moritz> cognominal: it's returns an empty List, not an empty Parcel.
Is that your problem?
<cognominal> see the first example, it prints "a\n".
<cognominal> I don't care if it is a parcel or a list. Whatever it is
should be empty.
<moritz> agreed
<cognominal> it does not happen when I delete the '?' suffix.
<moritz> though of course the ? quantifier on <a> should not affect $<b>
<cognominal> yes, that's my point.
<moritz> agreed. Bug it is.
<cognominal> it took me a while to golf it. Probably because my code
hits other bugs as well.
* masak submits rakudobug

Patrick R. Michaud via RT

unread,
May 17, 2012, 11:50:46 AM5/17/12
to perl6-c...@perl.org
Now fixed in 0ed00f0.... probably needs spectests to close ticket.

Thanks!

Pm
0 new messages