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

Improve kernel parser exceptions #103

Merged
merged 1 commit into from
Nov 27, 2022
Merged

Conversation

cache-nez
Copy link
Contributor

Most importantly, keep track of positions when parsing and report the error, highlighting the position where it occurred. Two types of errors are reported:

  • unexpected input: highlight the unexpected token and suggest expected kinds of input
  • expected term, got formula: highlight the unexpected formula

Since applications are eagerly converted to function or predicate application depending on the expected type, "expected formula, got term" error is currently not detected. This can be improved in the future.

Part of #86.

Most importantly, keep track of positions when parsing and report the error,
highlighting the position where it occurred. Two types of errors are reported:
* unexpected input: highlight the unexpected token and suggest expected kinds of input
* expected term, got formula: highlight the unexpected formula
Since applications are eagerly converted to function or predicate application
depending on the expected type, "expected formula, got term" error is currently
not detected.
Copy link
Collaborator

@vkuncak vkuncak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.
The test for error message does matching against a string, so we will need to maintain it in case the details of error reporting change.

@vkuncak vkuncak merged commit 28ede5d into epfl-lara:main Nov 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants