Skip to content

Conversation

flofriday
Copy link

This PR adds missing cases to how Kotlin number literals can be written and will now be correctly highlighted. All of these orginate from the Language Specification section 1.2.3

Here are some of the notable cases that didn't work before:

Binary literals with suffixes

val b1 = 0b1u
val b2 = 0b1U
val b3 = 0b1L

Hex literals with long suffix
While the unsigned suffix already worked here, the long didn't.

val h1 = 0xffL
val h2 = 0xffuL
val h3 = 0xffUL

Float litterals with leading dot

val f1 = .0f

E-notation with + or -

val r1 = 1.2E+3
val r2 = 1.2E-3

Seperator after e in E-notation

val r2 = 1.2E3_4

@github-actions github-actions bot added the grammar Related to the TextMate grammar, i.e. syntax highlighting label Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

grammar Related to the TextMate grammar, i.e. syntax highlighting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant