3 ms·
If you want good error reporting from grammars then you really need to implement a FAILGOAL in the grammar. For example: method FAILGOAL($goal) { die "cannot
by donaldihunter 9y ago
If you want good error reporting from grammars then you really need to implement a FAILGOAL in the grammar. For example:
method FAILGOAL($goal) { die "cannot find $goal near position {self.pos}" }
There is also a very helpful grammar tracer and debugger when developing a grammar:
use Grammar::Tracer;
or
use Grammar::Debugger;
https://github.com/jnthn/grammar-debugger https://github.com/jnthn/grammar-debugger
- thormick 9y agoI managed to not only read that several times over as FAILGOAT, but think that, yes, that sounds like an awesome solution.