-
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
Use Rust Parser from Java instead of AST.scala #3611
Use Rust Parser from Java instead of AST.scala #3611
Conversation
lib/rust/parser/generate-java/java/org/enso/syntax2/Parser.java
Outdated
Show resolved
Hide resolved
With 3ef9022 the |
@JaroslavTulach How can I run these tests? I've tried |
There is a primitive build system in |
Updated to most recent
|
Twelve more files produce
|
79b58d1
to
dc87923
Compare
I am trying:
and that fails complaining there is no parser library
running |
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.
It's great to see that we're passing tests with the new parser--it is working for correct inputs. However there are a few (small) things necessary to handle syntax errors gracefully, and I think that's important enough to the libraries-developer experience that we should do it before changing the default parser.
The 3 things we need are:
- https://www.pivotaltracker.com/story/show/183405907: 2 days of work Rust side; this is the next thing on my agenda. (Edit: implemented in Ensure parses of invalid inputs represent all tokens #3860)
- https://www.pivotaltracker.com/story/show/183740897: Make errors (
IR$Error$Syntax
), not exceptions, in TreeToIr. - When an invalid escape sequence is encountered,
getValue()
returns -1. CurrentlyTreeToIr
throws an exception in that case; I think inserting the Unicode "replacement character" U+FFFD (�) would be a better way to handle it. (In the future, the lexer will also emit a warning when encountering such a case; this is part of https://www.pivotaltracker.com/story/show/182963507 because lexer warnings depend on frontend-related UUID work).
2a61405
to
8f33e0a
Compare
Created #3861 to address the problem of errors (
Shouldn't the
behaves differently between the old and new parser. However there is no |
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.
lgtm
@@ -39,7 +39,7 @@ class AtomFixtures extends DefaultInterpreterRunner { | |||
val reverseListCode = | |||
"""from Standard.Base.Data.List import all | |||
| | |||
|main = list -> | |||
|main = self -> list -> |
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.
a TODO to figure out why self
parameter is needed?
I think it's important to maintain a distinction between a valid escape with value
Ah, that's a great test case! The lexer accepts up to 2 hexadecimal characters in the In the meantime, an example of an invalid escape would be: |
Done in 56f04d6. Let's integrate. |
Enabling Rust based parser as the default Enso parser. Disabling few currently failing tests - marking their appropriate reproducers as
@Ignore
d inEnsoCompilerTest
. IntroducingENSO_PARSER
property to allow anyone to switch to old parser in case of problems. Just use:and you temporarily get the exact behavior you are used to.
Checklist
Scala,
Java,
style guides.
./run ide build
and./run ide watch
.