-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undefined behavior when errors in the parser are found #19
Comments
@ziotom78 If you don't mind me asking, what do you mean by an organic presentation of how errors are handled? Anyway, I improved the documentation on exceptions a little. Thanks for pointing that out. (https://lark-parser.readthedocs.io/en/latest/classes.html#lark.Lark.parse) |
No worry! I meant that a reader would like to find something better than what's inside Lark's documentation. I had to dig a bit to discover how errors are handled, and I managed to find it because I tested with some code that As I said, your patch looks good and definitely useful, so I'll close this issue. |
Sorry, I'm reopening this because I realized that the docs you linked above refer to Lark and not to Lerch.jl. Is the improvement in the documentation already available somewhere? The last commit I see in |
I will leave that to James to answer. But I believe Lerche's behavior should match Lark's in this case. |
I have updated the |
Great, thanks! |
The documentation does not mentions what happens when there is an error in the source text passed to the parser. It seems that, similarly to Lark, exceptions are thrown, and these exceptions share the same name as Lark's (
UnexpectedInput
,UnexpectedCharacters
,UnexpectedToken
):Although Lark's documentation lacks an organic presentation of how error are handled (but it does document
UnexpectedToken
andUnexpectedCharacters
in the documentation forUnexpectedInput
), I believe that the usage of exceptions to signal errors and their type should be mentioned somewhere in Lerche's documentation, as this is an important piece of information that helps to ensure robustness in codes.Disclaimer: this issue was opened following the review happening here: openjournals/joss-reviews#3497.
The text was updated successfully, but these errors were encountered: