j-mie6 / parsley

A fast and modern parser combinator library for Scala
https://j-mie6.github.io/parsley/
BSD 3-Clause "New" or "Revised" License
173 stars 15 forks source link

Better crash diagnostics #232

Open j-mie6 opened 5 months ago

j-mie6 commented 5 months ago

Occasionally, parsley can throw an error from within an instruction execution. There are three main sources for this to occur within:

It would be good to try and distinguish between these, where possible, and catch any exceptions generated within the parser. These can be rethrown from outside the parsing context, removing any noise for user-made errors, report likely causes from undefined behaviour within parsley, and otherwise provide a more useful and detailed diagnostic for me that can be used in a bug report.