Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(kotlin): classes with newlines (#476)
## 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: ``` class Foo constructor Bar() { ... } ``` Here, we insert an automatic semicolon between `Foo` and `constructor`. This leaves us able to parse `class Foo` as a `class_declaration`, but `constructor 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` and `test-lang kotlin` ### Security - [ ] Change has no security implications (otherwise, ping the security team) --------- Co-authored-by: Amarin Phaosawasdi <amchiclet@users.noreply.github.com>
- Loading branch information
1 parent
7093394
commit 878e710
Showing
2 changed files
with
184 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters