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


<jnthn> nom: grammar a { token x { a }; token y { z }; rule TOP {
[<x>]? [b <y> || c] } }; say a.parse('a b z')
<p6eval> nom 327fc9: OUTPUT«=> <a b z>␤ x => <a>␤ y => <z>␤␤»
<jnthn> nom: grammar a { token x { a }; token y { z }; rule TOP {
[<x>]? [c || b <y>] } }; say a.parse('a b z')
<p6eval> nom 327fc9: OUTPUT«=> <a b z>␤ y => <z>␤␤»
<jnthn> ah, there it is :(
<masak> jnthn: o.O
<jnthn> nom: grammar a { token x { a }; token y { z }; rule TOP { <x>
[c || b <y>] } }; say a.parse('a b z')
<p6eval> nom 327fc9: OUTPUT«=> <a b z>␤ x => <a>␤ y => <z>␤␤»
<jnthn> nom: grammar a { token x { a }; token y { z }; rule TOP {
[<x>]? [c || b <y>] } }; say a.parse('a b z')
<p6eval> nom 327fc9: OUTPUT«=> <a b z>␤ y => <z>␤␤»
<jnthn> masak: You spot the issue?
<jnthn> Seems it needs an alternation that fails and a previously
quantified match.
<jnthn> masak: Feel free to RT that
* masak submits rakudobug
<masak> jnthn: I think I spot it. the order of rhs and lhs around '||'
affects captures.
<jnthn> yeah but only if the previous capture was quantified.
<masak> ah, right.
<masak> insidious.
<jnthn> masak: yeah, no fun to find

Reply via email to