Please add Kotlin & Groovy lexers.
Or, what is the best way to copy LexCPP.cxx and add the new keywords from Kotlin?
Any help appreciated.
Thanks
Commit: [221bd4]
Commit: [465ef8]
Commit: [769d2a]
Commit: [fe170a]
Keywords are specified at runtime with SCI_SETKEYWORDS so there is no need to copy a lexer if the languages are lexically similar like C++, Java, and C# are.
Kotlin is dissimilar enough from C++ to make reusing the C++ lexer a poor choice. The language has a number of features that are incompatible with C++ lexing:
)...."${ ... }".""" ... """.1_000.@JvmStatic.#character other than in a shebang line.I don’t know Groovy very well, but as far as I know all but the first two points above apply to it too. And all but the first three apply to Java itself as well (since Java 13), to the point where I believe writing a separate lexer for Java is warranted.
Last edit: felix 2021-02-11
there are two lexers for Kotlin:
(up to date, old style lexer) https://github.com/zufuliu/notepad2/blob/master/scintilla/lexers/LexKotlin.cxx
(implemented ILexer5/DefaultLexer) https://github.com/rizonesoft/Notepad3/blob/master/lexilla/src/lexers_x/LexKotlin.cxx
I think Groovy need a separator lexer, it support all Java (except for Java 16 record) features, with many kind of strings (with interpolations, two kind of escape sequences), and other syntax sugars.