softdevteam / lrpar

Rust LR parser
Other
1 stars 0 forks source link

Switchable recoverers #55

Closed ltratt closed 6 years ago

ltratt commented 6 years ago

This PR first adds a "none" recoverer (so one can switch recovery off) and then exposes that via a -r switch to the outside world. There are then a couple of "cosmetic" fixes, including returning non-zero to the outside world on an unsuccessful parse (which I should have added ages ago, as it's very useful).

A quick example:

$ target/debug/lrpar -r none -y eco java.l java.y bad.java

Unable to repair input sufficiently to produce parse tree.

Error detected at line 2 col 12. No repairs found.
$ echo $?
1