-
Notifications
You must be signed in to change notification settings - Fork 10
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(kotlin): classes with newlines #476
Conversation
FYI |
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.
Not a fan of all the formatting changes in the tests. I guess the "hide whitespace" setting only has to do with whitespace changes on a single line, so to review, one still has to compare these manually.
I spot-checked some and they looked the same, but I'm assuming with this review that the only behavior change is for the added test cases.
Also spot checked and arrived at the same conclusion. The only behavior change is the new test cases. Thanks for the quick review! |
the formatting changes are automatically generated from |
In the future, I'd prefer reformatting to be split into a separate PR |
What:
This PR makes it so we can parse Kotlin classes that have a newline between the class identifier and constructor.
Why:
Parse rate.
How:
The problem is in cases like:
Here, we insert an automatic semicolon between
Foo
andconstructor
. This leaves us able to parseclass Foo
as aclass_declaration
, butconstructor Bar ...
is not allowed on its own.We simply allow
constructor Bar ...
to be a standalone statement, and resolve to stitch them together at parsing time.Testing
Tested with
make test
andtest-lang kotlin
Security