Description
One of the "fun" things about my project is running the parser on strange, half edited/incomplete changes.
Here is one such case I encountered that way, and have minimized.
given the input character a
, this will cause an infinite loop pushing to pstack
between
https://github.com/softdevteam/grmtools/blob/master/lrpar/src/lib/parser.rs#L297
https://github.com/softdevteam/grmtools/blob/master/lrtable/src/lib/statetable.rs#L461-L466
adding a case like: Some(i) if i == usize::from(stidx) + 1 => None,
to goto
fixes it, (i.e. the return value of goto == prior
).
Filing this as a bug report rather than sending a PR though, because I haven't yet tested it against valid parsers, or
as of yet tried to surmise if this case can only and always lead to infinite recursion or if it ever actually comes up in a valid way.
%%
a "a"
[\t\n ] ;
%%
Start: Bar;
Foo: "a" | ;
Bar: Foo | Foo Bar;