Repository navigation
fix: parsing crashes on code with errors - #65
Conversation
|
I'm not sure this exactly the right fix, as the error cases showing 'unknown token: eot' is exposing an implementation detail that isn't a real syntax error. I think you can maybe split the struct error into its own PR. I'll dig into it more, how does the tokenizer actually tokenize that special << character? |
As
Will do. Also for that one I'm not 100% either that the behavior I chose is the one we really want either, we can discuss further there |
79b5b25 to
5ed6d78
Compare
|
I merged #67 which fixes the weird character issue. I need to go to bed, but have another fix in flight for the other error. The issue is that it should detect if there is a closing bracket/brace/paren when it wasn't expected one, report the error, and continue parsing. If you want to look into it tomorrow during the day, it'll be around the validate_peek function and look at those "is_list", etc variables in the parse_expression function. Otherwise i can tackle it tomorrow evening. |
5ed6d78 to
7a264fc
Compare
|
@mhanberg it seems the issue was caused by
|
|
One thing that caught my attention is that we have a test with this snippet( This would incorrectly report an unexpected Essentially we:
I think dropping |
Probably best to discuss in a separate issue about improving error recovery. |
|
@doorgan please rebase this and update the description if needed. I think i lost track of what this is fixing because we broke other parts into other PRs |
7a264fc to
5ad9bd7
Compare
Spitfire.parse_with_comments("@x ]")crashes instead of returning an error:This fixes that, and other very similar errors related to stray closing delimiters