https://kotlinlang.org logo
#language-evolution
Title
# language-evolution
t

Tomasz Krakowiak

06/15/2021, 8:09 PM
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)
e

ephemient

06/15/2021, 8:26 PM
dunno about
?:
, but a prefix
!!bool
is legal, although pointless
r

Ruckus

06/15/2021, 9:20 PM
🌮 1
‼️ 3