Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

captures are not made properly around '||' if previous capture was quantified #2606

Closed
p6rt opened this issue Jan 8, 2012 · 4 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Jan 8, 2012

Migrated from rt.perl.org#107746 (status was 'resolved')

Searchable as RT107746$

@p6rt
Copy link
Author

p6rt commented Jan 8, 2012

From @masak

<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

@p6rt
Copy link
Author

p6rt commented Jan 4, 2013

From @moritz

Fixed, and tested in S05-capture/named.t

@p6rt
Copy link
Author

p6rt commented Jan 4, 2013

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jan 4, 2013

@moritz - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant