Skip to content

Conversation

@AlexandrosAlexiou
Copy link

Implements exclusive range operator (..<) from Kotlin 1.7.20+

Problem:
Grammar only supported inclusive (..) range, missing exclusive (..<). Code like 'for (i in 0..<10)' would fail to parse.

Changes:

  • grammar.js: range_expression accepts '..' and '..<'
  • highlights.scm: Added '..<' operator

Example:
for (i in 0..10) // 0,1,2,...,10 (inclusive)
for (i in 0..<10) // 0,1,2,...,9 (exclusive)

Reference: https://kotlinlang.org/docs/ranges.html
Tests: 111/111 pass

Implements exclusive range operator (..<) from Kotlin 1.7.20+

Problem:
Grammar only supported inclusive (..) range, missing exclusive (..<).
Code like 'for (i in 0..<10)' would fail to parse.

Changes:
- grammar.js: range_expression accepts '..' and '..<'
- highlights.scm: Added '..<' operator

Example:
  for (i in 0..10)   // 0,1,2,...,10 (inclusive)
  for (i in 0..<10)  // 0,1,2,...,9  (exclusive)

Reference: https://kotlinlang.org/docs/ranges.html
Tests: 111/111 pass
@github-actions github-actions bot added the grammar Related to the grammar label Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

grammar Related to the grammar

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant