kschiess / parslet

A small PEG based parser library. See the Hacking page in the Wiki as well.
kschiess.github.com/parslet
MIT License
809 stars 95 forks source link

no more Parslet::UnconsumedInput #113

Closed jrochkind closed 10 years ago

jrochkind commented 10 years ago

Hi, I have some code that uses Parslet that at one point does a

rescue Parslet::UnconsumedInput

However, apaprently there's no longer such an exception class in Parslet in 1.6.1?

Was I using internal API I shouldn't have been, or was there an accidentally backwards incompatibility introduced?

Is there another exception class I can paste in there that does the same thing? I have to admit I haven't re-comprehended this code I wrote awhile ago again, to understand exactly what I was doing.

Thanks for any advice!

kschiess commented 10 years ago

This is not an issue, it's a call for help. As such, the mailing list is the place to put it.

UnconsumedInput was raised whenever a parse could not consume all the input. Now this is just a parse error. It really depends on what your rescue clause does... But have a look at https://github.com/kschiess/parslet/blob/master/lib/parslet/atoms/base.rb#L18-L19 - you might just accept prefix matches in your case.

jrochkind commented 10 years ago

Okay, thanks. I thought it may have been an issue because it may have been an unintentional backwards compatibility introduction.