jnthn / grammar-debugger

Grammar::Debugger and Grammer::Tracer Perl 6 modules
36 stars 20 forks source link

Constant string matches are not reported #27

Open vlmarek opened 8 years ago

vlmarek commented 8 years ago
grammar G {
        token TOP { <a> b <c> }
        token a { a }
        token c { c }
}

say so G.parse('abc');
TOP
|  a
|  * MATCH "a"
|  c
|  * MATCH "c"
* MATCH "abc"
True

There is no mention of 'b' being matched until whole TOP matched. In complex grammars it's difficult to spot what last thing was matched before failure.