Skip to content
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

Better handling of exceptions when walking parse trees #1026

Open
degory opened this issue Jan 23, 2024 · 0 comments
Open

Better handling of exceptions when walking parse trees #1026

degory opened this issue Jan 23, 2024 · 0 comments

Comments

@degory
Copy link
Owner

degory commented Jan 23, 2024

Handling exceptions when walking parse trees is messy and doesn't always leave the diagnostics stack and other state consistent. This is mainly caused by having separate pre() and visit() methods in the visitors. Ideally we'd have a single method to override in the visitor per parse tree, so we can store any state in local variables, and that state can be restored from a single try/catch/finally wrapping all of the pre-walk actions, the walk over all children, and the post-walk (visit) actions.

degory added a commit that referenced this issue Jan 23, 2024
Bug fixes:
- Partial fix for issue where syntax errors could result either no diagnostic messages, or diagnostic messages with an excessive range (fixes some causes but not all, see #1026)

Technical:
- Remove dead code relating to stable symbols and .NET library stubs
degory added a commit that referenced this issue Jan 23, 2024
Bug fixes:
- Partial fix for issue where syntax errors could result either no diagnostic messages, or diagnostic messages with an excessive range (fixes some causes but not all, see #1026)

Technical:
- Remove dead code relating to stable symbols and .NET library stubs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant