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

Fix context handling for IR errors #3

Closed
2 tasks done
WillBAnders opened this issue May 3, 2022 · 2 comments
Closed
2 tasks done

Fix context handling for IR errors #3

WillBAnders opened this issue May 3, 2022 · 2 comments

Comments

@WillBAnders
Copy link
Contributor

WillBAnders commented May 3, 2022

Currently, the context field for RhovasIr is never initialized for use in errors. I believe the primary issues here were with testing and library functions were unable to access the IR of their arguments, thus it never ended up being a priority. Therefore, this has two tasks:

  • RhovasIr needs to have it's context field initialized, which should be used in errors for the analyzer/evaluator
  • Standard library functions should have some method of accessing argument context and potentially the surrounding function
@WillBAnders
Copy link
Contributor Author

This has a much wider scope than originally anticipated. Unlike the parser, semantic analysis errors should include context for things like variable declarations, assignments, and refined types. This requires a much more sophisticated approach to handling context than I had foreseen.

I think the next step with this is to build a mini-specification for what information should be included, and start with simple things like including the declaration for variables - anything before that is a bit too trivial and probably wouldn't justify the effort.

@WillBAnders
Copy link
Contributor Author

First part for RhovasIr context was implemented in 12b58db; going to address the second part in this issue as well. Going to consider adding more context to the analyzer as a separate feature rather than part of this bug and will open a new issue for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant