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
Grammar 'ident' override behaviour #3246
Comments
From @dwarringThe final parse below is failing to match (golfed from CSS::Grammar): use v6; grammar G { token nmstrt {<[_ a..z A..Z]>} proto token term { <...> } } say G.parse("-my-ident", :rule<ident>); # parsing grammar G { token nmstrt {<[_ a..z A..Z]>} proto token term { <...> } } say G.parse("-my-ident", :rule<ident>); # parsing Parse failing on both Parrot and JVM.This has been a problem since about Parse succeeds if I uncomment 'use Grammar::Tracer', ie Heisenbug. |
From @dwarringGaah, sorry about the jumble above. Sample case restated below: use v6; grammar G { token nmstrt {<[_ a..z A..Z]>} proto token term { <...> } } say G.parse("-my-ident", :rule<ident>); # ok |
@dwarring - Status changed from 'new' to 'open' |
From @dwarringI've added a failing (todo) test to S05-grammar/protoregex.t in perl6/roast. |
From @dwarringI've converted the test case to NQP: # nqp bisection for RT #120146 grammar G { token nmstrt {<[ _ a..z ]>} proto token term {*} my $result := 'nok'; if (G.parse("-my_id", :rule<term>)) { say("$result - term parse"); ...and bisected in NQP: commit 9ee3ed7235c9f7110d119ef748cac39a62517e77 Treat ident declaratively. Aha. with that commit, ident is now treated more declatively, so re-declaring ident has become problematic. |
From @dwarringI've added another test to S05-grammar/protoregex.t for the following variation - 'ident' as an alias: say("1..1"); grammar G { token nmstrt {<[ _ a..z ]>} proto token term {*} my $result := 'nok'; if (G.parse("-my_id", :rule<term>)) { say("$result - term parse"); |
Maybe the built-in rules should('ve) be uppercase anyway, e.g. |
Migrated from rt.perl.org#120146 (status was 'open')
Searchable as RT120146$
The text was updated successfully, but these errors were encountered: