grammar-debugger
grammar-debugger copied to clipboard
Constant string matches are not reported
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.