tree-sitter-kotlin
tree-sitter-kotlin copied to clipboard
allow type params before navigation suffix
In my pursuits running the Kotlin parser on many open-source repos, I've noticed that a very common we cannot parse is expressions of the form Foo<*>::bar. It seems that this is an example of suffixing an expression with type parameters, and then doing a navigation suffix.
Unfortunately, it seems that naively writing the grammar with type parameters after arbitrary expressions is a surefire way to break comparison expressions. I decided to follow the same form as call_suffix, and instead allow type parameters in only a particular suffix, that being navigation suffixes.
Now, it works. Our parse rate went up like a percent as a result.
Test plan: Automated tests.
This is awesome @brandonspark. I sincerely hope that you keep contributing! I thought that this repo was losing traction but it seems I was wrong! Thank you @fwcd and @brandonspark! :)
Thanks for investigating! Please rebase it onto main (as always), so we can run CI.