-
Notifications
You must be signed in to change notification settings - Fork 323
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
Ensure parses of invalid inputs represent all tokens #3860
Conversation
test_invalid("polyglot java import"); | ||
test_invalid("from import all"); | ||
test_invalid("from Foo import all hiding"); | ||
test_invalid("from Foo import all hiding X.Y"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handling the previous tests by b8f9124 - the following tests are rather malformed_export
ones, btw.
However there is no IR.Error.Syntax.InvalidExport
, just InvalidImport
, so I am using it in: 6df12fa as well. Probably using such reason may not matter much as it is mostly an internal object not shown to the user.
However the error messages are still "Imports must have a valid path."
and if shown to users, they may get confused by that.
test_invalid("foreign 4 * 4"); | ||
test_invalid("foreign foo = \"4\""); | ||
test_invalid("foreign js foo = 4"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All tests in this file were converted into https://github.com/enso-org/enso/blob/e9227323a2aada032e376fd2cf8891f1ab94fd3c/engine/runtime/src/test/java/org/enso/compiler/ErrorCompilerTest.java and are handled appropriately.
Pull Request Description
Ensure all tokens from the input are represented in trees resulting from invalid inputs--tests now cover every reachable code line that creates an
Invalid
node. (Also implemented stricter validation, mainly ofimport
/export
statements.)See: https://www.pivotaltracker.com/story/show/183405907
Important Notes
Checklist
Please include the following checklist in your PR:
Scala,
Java,
and
Rust
style guides.
./run ide build
and./run ide watch
.