cronburg / antlr-haskell

A language parsing quasiquoter for Haskell based heavily on ANTLR4.
Other
49 stars 7 forks source link

GLR parser incorrectly reports correct parse with input still remaining #32

Open cronburg opened 5 years ago

cronburg commented 5 years ago

When the parser finishes parsing the top-level non-terminal of a grammar and has reached a point in the input where it cannot perform any more parsing actions, the GLR parser incorrectly reports a successful parse by ignoring the remaining input.

cronburg commented 5 years ago

Coding difficulty: low (simply return the ErrorNoAction if there's input left to be parsed) Mental difficulty: low (edge case that needs to be fixed)

cronburg commented 5 years ago

To get started on this issue look at the unit test in test/lr/GLRPartial.hs, running it with:

stack test antlr-haskell:lr 

which fails in the following way:

test_GLRPartial: [Failed]
Was not suppose to parse: [word, word, word]