I was analysing Kotlin antlr grammar and I noticed few strange things.
I wonder if anyone could explain why were they implemented this way:
1. WS is "-> channel(HIDDEN)", but NL is not.
2. Why fragment Hidden is needed?
3. Why fragment Hidden does not include NL?
I found that, how "?:" and "!!" depend on this weird definition, but wouldn't it be cleaner to define them as separate tokens?
(lexer grammar -
https://github.com/Kotlin/kotlin-spec/blob/release/grammar/src/main/antlr/KotlinLexer.g4)