| 1 |
|
| 2 |
(simple_identifier) @variable |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
((simple_identifier) @variable.builtin |
| 8 |
(#eq? @variable.builtin "field")) |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
((simple_identifier) @variable.builtin |
| 14 |
(#eq? @variable.builtin "it")) |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
[ |
| 20 |
"." |
| 21 |
"," |
| 22 |
";" |
| 23 |
":" |
| 24 |
"::" |
| 25 |
] @punctuation.delimiter |
| 26 |
|
| 27 |
[ |
| 28 |
"(" ")" |
| 29 |
"[" "]" |
| 30 |
"{" "}" |
| 31 |
] @punctuation.bracket |
| 32 |
|
| 33 |
[ |
| 34 |
"!" |
| 35 |
"!=" |
| 36 |
"!==" |
| 37 |
"=" |
| 38 |
"==" |
| 39 |
"===" |
| 40 |
">" |
| 41 |
">=" |
| 42 |
"<" |
| 43 |
"<=" |
| 44 |
"||" |
| 45 |
"&&" |
| 46 |
"+" |
| 47 |
"++" |
| 48 |
"+=" |
| 49 |
"-" |
| 50 |
"--" |
| 51 |
"-=" |
| 52 |
"*" |
| 53 |
"*=" |
| 54 |
"/" |
| 55 |
"/=" |
| 56 |
"%" |
| 57 |
"%=" |
| 58 |
"?." |
| 59 |
"?:" |
| 60 |
"!!" |
| 61 |
"is" |
| 62 |
"in" |
| 63 |
"as" |
| 64 |
"as?" |
| 65 |
".." |
| 66 |
"->" |
| 67 |
] @operator |
| 68 |
|
| 69 |
e. |
| 70 |
(nullable_type (quest) @operator) |
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
(string_literal |
| 75 |
(interpolation_identifier_start) @punctuation.special |
| 76 |
(interpolated_identifier) @variable) |
| 77 |
(string_literal |
| 78 |
(interpolation_expression_start) @punctuation.special |
| 79 |
(interpolated_expression) @none |
| 80 |
(interpolation_expression_end) @punctuation.special) |
| 81 |
|
| 82 |
|
| 83 |
((interpolated_identifier) @variable.builtin |
| 84 |
(#eq? @variable.builtin "it")) |
| 85 |
((interpolated_identifier) @variable.builtin |
| 86 |
(#eq? @variable.builtin "this")) |
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
(type_alias "typealias" @keyword) |
| 91 |
[ |
| 92 |
(class_modifier) |
| 93 |
(member_modifier) |
| 94 |
(function_modifier) |
| 95 |
(property_modifier) |
| 96 |
(platform_modifier) |
| 97 |
(variance_modifier) |
| 98 |
(parameter_modifier) |
| 99 |
(visibility_modifier) |
| 100 |
(reification_modifier) |
| 101 |
(inheritance_modifier) |
| 102 |
]@keyword |
| 103 |
|
| 104 |
[ |
| 105 |
"val" |
| 106 |
"var" |
| 107 |
"enum" |
| 108 |
"class" |
| 109 |
"object" |
| 110 |
"interface" |
| 111 |
"companion" |
| 112 |
|
| 113 |
] @keyword |
| 114 |
|
| 115 |
("fun") @keyword.function |
| 116 |
|
| 117 |
(jump_expression) @keyword.control.return |
| 118 |
|
| 119 |
[ |
| 120 |
"if" |
| 121 |
"else" |
| 122 |
"when" |
| 123 |
] @keyword.control.conditional |
| 124 |
|
| 125 |
[ |
| 126 |
"for" |
| 127 |
"do" |
| 128 |
"while" |
| 129 |
] @keyword.control.repeat |
| 130 |
|
| 131 |
[ |
| 132 |
"try" |
| 133 |
"catch" |
| 134 |
"throw" |
| 135 |
"finally" |
| 136 |
] @keyword.control.exception |
| 137 |
|
| 138 |
(annotation |
| 139 |
"@" @attribute (use_site_target)? @attribute) |
| 140 |
(annotation |
| 141 |
(user_type |
| 142 |
(type_identifier) @attribute)) |
| 143 |
(annotation |
| 144 |
(constructor_invocation |
| 145 |
(user_type |
| 146 |
(type_identifier) @attribute))) |
| 147 |
|
| 148 |
(file_annotation |
| 149 |
"@" @attribute "file" @attribute ":" @attribute) |
| 150 |
(file_annotation |
| 151 |
(user_type |
| 152 |
(type_identifier) @attribute)) |
| 153 |
(file_annotation |
| 154 |
(constructor_invocation |
| 155 |
(user_type |
| 156 |
(type_identifier) @attribute))) |
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
(character_literal (character_escape_seq) @constant.character.escape) |
| 161 |
|
| 162 |
(string_literal) @string |
| 163 |
|
| 164 |
(character_literal) @constant.character |
| 165 |
|
| 166 |
(boolean_literal) @constant.builtin.boolean |
| 167 |
(null_literal) @constant.builtin |
| 168 |
|
| 169 |
(real_literal) @constant.numeric.float |
| 170 |
[ |
| 171 |
(integer_literal) |
| 172 |
(long_literal) |
| 173 |
(hex_literal) |
| 174 |
(bin_literal) |
| 175 |
(unsigned_literal) |
| 176 |
] @constant.numeric.integer |
| 177 |
|
| 178 |
[ |
| 179 |
(line_comment) |
| 180 |
(multiline_comment) |
| 181 |
(shebang_line) |
| 182 |
] @comment |
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
(enum_entry |
| 187 |
(simple_identifier) @constant) |
| 188 |
|
| 189 |
|
| 190 |
((simple_identifier) @constant |
| 191 |
(#match? @constant "^[A-Z][A-Z0-9_]*$")) |
| 192 |
|
| 193 |
|
| 194 |
|
| 195 |
|
| 196 |
(_ |
| 197 |
(navigation_suffix |
| 198 |
(simple_identifier) @variable.other.member)) |
| 199 |
|
| 200 |
|
| 201 |
(call_expression |
| 202 |
. (simple_identifier) @function) |
| 203 |
|
| 204 |
|
| 205 |
(call_expression |
| 206 |
(navigation_expression |
| 207 |
(navigation_suffix |
| 208 |
(simple_identifier) @function) . )) |
| 209 |
|
| 210 |
|
| 211 |
(infix_expression |
| 212 |
. (_) . |
| 213 |
(simple_identifier) @function) |
| 214 |
|
| 215 |
|
| 216 |
(call_expression |
| 217 |
. (simple_identifier) @function.builtin |
| 218 |
(#match? @function.builtin "^(arrayOf|arrayOfNulls|byteArrayOf|shortArrayOf|intArrayOf|longArrayOf|ubyteArrayOf|ushortArrayOf|uintArrayOf|ulongArrayOf|floatArrayOf|doubleArrayOf|booleanArrayOf|charArrayOf|emptyArray|mapOf|setOf|listOf|emptyMap|emptySet|emptyList|mutableMapOf|mutableSetOf|mutableListOf|print|println|error|TODO|run|runCatching|repeat|lazy|lazyOf|enumValues|enumValueOf|assert|check|checkNotNull|require|requireNotNull|with|suspend|synchronized)$")) |
| 219 |
|
| 220 |
|
| 221 |
(_ |
| 222 |
(navigation_suffix |
| 223 |
(simple_identifier) @constant |
| 224 |
(#match? @constant "^[A-Z][A-Z0-9_]*$"))) |
| 225 |
|
| 226 |
|
| 227 |
((navigation_expression |
| 228 |
. (simple_identifier) @type) |
| 229 |
(#match? @type "^[A-Z]")) |
| 230 |
|
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
(lambda_literal |
| 235 |
(lambda_parameters |
| 236 |
(variable_declaration |
| 237 |
(simple_identifier) @variable.parameter))) |
| 238 |
|
| 239 |
(parameter_with_optional_type |
| 240 |
(simple_identifier) @variable.parameter) |
| 241 |
|
| 242 |
(parameter |
| 243 |
(simple_identifier) @variable.parameter) |
| 244 |
|
| 245 |
|
| 246 |
(value_argument |
| 247 |
. (simple_identifier) @variable.parameter) |
| 248 |
|
| 249 |
(anonymous_initializer |
| 250 |
("init") @constructor) |
| 251 |
|
| 252 |
(constructor_invocation |
| 253 |
(user_type |
| 254 |
(type_identifier) @constructor)) |
| 255 |
|
| 256 |
(secondary_constructor |
| 257 |
("constructor") @constructor) |
| 258 |
(primary_constructor) @constructor |
| 259 |
|
| 260 |
(getter |
| 261 |
("get") @function.builtin) |
| 262 |
(setter |
| 263 |
("set") @function.builtin) |
| 264 |
|
| 265 |
|
| 266 |
(function_declaration |
| 267 |
(modifiers)? |
| 268 |
(type_parameters)? |
| 269 |
(simple_identifier) @function) |
| 270 |
|
| 271 |
|
| 272 |
(function_declaration |
| 273 |
receiver: (receiver_type) |
| 274 |
(simple_identifier) @function) |
| 275 |
|
| 276 |
|
| 277 |
|
| 278 |
(label) @label |
| 279 |
|
| 280 |
(import_header |
| 281 |
(identifier |
| 282 |
(simple_identifier) @function @_import .) |
| 283 |
(import_alias |
| 284 |
(type_identifier) @function)? |
| 285 |
(#match? @_import "^[a-z]")) |
| 286 |
|
| 287 |
|
| 288 |
|
| 289 |
(import_header |
| 290 |
(identifier |
| 291 |
(simple_identifier) @type @_import) |
| 292 |
(import_alias |
| 293 |
(type_identifier) @type)? |
| 294 |
(#match? @_import "^[A-Z]")) |
| 295 |
|
| 296 |
(import_header |
| 297 |
"import" @keyword.control.import) |
| 298 |
|
| 299 |
(package_header |
| 300 |
. (identifier)) @namespace |
| 301 |
|
| 302 |
(type_identifier) @type |
| 303 |
|
| 304 |
((type_identifier) @type.builtin |
| 305 |
(#match? @type.builtin "^(Byte|Short|Int|Long|UByte|UShort|UInt|ULong|Float|Double|Boolean|Char|String|Array|ByteArray|ShortArray|IntArray|LongArray|UByteArray|UShortArray|UIntArray|ULongArray|FloatArray|DoubleArray|BooleanArray|CharArray|Map|Set|List|EmptyMap|EmptySet|EmptyList|MutableMap|MutableSet|MutableList)$")) |
| 306 |
|
| 307 |
(type_parameter |
| 308 |
(type_identifier) @type.parameter) |
| 309 |
|
| 310 |
((class_body |
| 311 |
(property_declaration |
| 312 |
(variable_declaration |
| 313 |
(simple_identifier) @variable.other.member))) |
| 314 |
(#not-match? @variable.other.member "^[A-Z][A-Z0-9_]*$")) |
| 315 |
|
| 316 |
|
| 317 |
(property_declaration |
| 318 |
receiver: (receiver_type) |
| 319 |
(variable_declaration |
| 320 |
(simple_identifier) @variable.other.member)) |
| 321 |
|
| 322 |
(class_parameter |
| 323 |
(simple_identifier) @variable.other.member) |
| 324 |
|
| 325 |
|
| 326 |
(super_expression) @variable.builtin |
| 327 |
|
| 328 |
|
| 329 |
(this_expression) @variable.builtin |