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::Tracer changes outcome of parse #13
Comments
, too. I mean I still have to dig my way through the ticket you linked to. However, even if there may be (ie apart from any) bugs in the example grammars given:
... I do get the very strong feeling, that this could be yet another symptom of a rather general flaw regarding how state (of Tracer/Debugger as well as the current parse) is handled. The baseline is that state should be dynamic, rather than static. Maybe this rings a bell for you, as you're into the specific example...? Cheers :) |
|
I've found this in a grammar I wrote as well. Golfed version: use Grammar::Tracer;
grammar CppGrammar {
proto token type { * }
token type:builtin {
[
|| 'const char *'
|| 'void'
]
}
rule type:identifier {
<?>
'const'?
\w+
$<pointy>=[<[&*]>* % <.ws>]
}
}
class MyActions {
method type:builtin ($/) {
make 'builtin'
}
method type:identifier ($/) {
make 'identifier'
}
}
say CppGrammar.parse('const char *', :rule<type>, :actions(MyActions)).made;Prints |
|
Tracing breaks the logic of NFAs where, conceptually, the rules are entered in parallel to use Grammar::Tracer; |
Whatever NFA is, is it possible to somehow reproduce the matching results that |
|
Certainly possible; it's "just" a matter of someone diving in and fixing it. For what it's worth, you're not the only one who's frustrated. Here's my latest conversation about this with @jnthn, four days ago: |
|
Fixed, previously failing test case now passes. Bumped version. Also a few other small tweaks/cleanups along the way. |
See https://rt.perl.org/Ticket/Display.html?id=123452 for a concrete example. That ticket also establishes that Rakudo is right (when it fails the grammar), and Grammar::Tracer is wrong (when it makes it parse).
The text was updated successfully, but these errors were encountered: