You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consumer::run() should ideally stop execution (at least stop calling Consumer::consume with invalid data) when this happens. With the current behavior, it's impossible to recover from parsing invalid data using a Consumer.
The text was updated successfully, but these errors were encountered:
Good catch! I added a failed method to the consumer trait that will be called (and end the loop) if the parsing failed: 35a7bfa
Would that be ok for your needs? I have to admit that I am less fond of the consumer system now, there may be a better way to encode a state machine. I'll let you know if I advance on this.
Yeah, that seems to work nicely! I think it might be a bit nicer to directly return a Result<> from the run method, but this way of doing things works as well!
If you return ConsumerError from Consumer::consume, Consumer::run will essentially run in an infinite loop. I think this is due to the empty match branch in https://github.com/Geal/nom/blob/master/src/consumer.rs#L162.
Consumer::run() should ideally stop execution (at least stop calling Consumer::consume with invalid data) when this happens. With the current behavior, it's impossible to recover from parsing invalid data using a Consumer.
The text was updated successfully, but these errors were encountered: