Kotlin / kotlin-spec

Kotlin Language Specification:
https://kotlinlang.org/spec
Apache License 2.0
387 stars 80 forks source link

Specification on Automatic Semicolon Insertion #124

Closed VladimirMakaev closed 10 months ago

VladimirMakaev commented 11 months ago

I'm trying to implement Automatic Semicolon Insertion in an open source Kotlin parser (https://github.com/fwcd/tree-sitter-kotlin) but the information about it is missing from the language spec. The linked library has some "naive" implementation but with the proper spec it would much easier for people to contribute there. Tree-sitter is the source for language support for many tools and editors and I believe having ASI sorted will dramatically improve the tooling quality. Not having this in the spec creates additional barrier for contributors

It would help if this is added to the spec (or as some sort of Appendix or an article) as for instance for JavaScript: https://262.ecma-international.org/7.0/#sec-rules-of-automatic-semicolon-insertion

VladimirMakaev commented 10 months ago

I think this issue isn't relevant after I looked how Kotlin grammer is defined in the sources