|
1 |
| -(unit |
2 |
| - (identifier) @variable) |
| 1 | +[ |
| 2 | + "!instanceof" |
| 3 | + "assert" |
| 4 | + "class" |
| 5 | + "extends" |
| 6 | + "instanceof" |
| 7 | + "package" |
| 8 | +] @keyword |
3 | 9 |
|
4 |
| -(string |
5 |
| - (identifier) @variable) |
| 10 | +[ |
| 11 | + "!in" |
| 12 | + "as" |
| 13 | + "in" |
| 14 | +] @keyword.operator |
| 15 | + |
| 16 | +[ |
| 17 | + "case" |
| 18 | + "default" |
| 19 | + "else" |
| 20 | + "if" |
| 21 | + "switch" |
| 22 | +] @keyword.conditional |
6 | 23 |
|
7 |
| -(escape_sequence) @constant.character.escape |
| 24 | +[ |
| 25 | + "catch" |
| 26 | + "finally" |
| 27 | + "try" |
| 28 | +] @keyword.exception |
8 | 29 |
|
9 |
| -(block |
10 |
| - (unit |
11 |
| - (identifier) @namespace)) |
| 30 | +"def" @keyword.function |
12 | 31 |
|
13 |
| -(func |
14 |
| - (identifier) @function) |
| 32 | +"import" @keyword.import |
15 | 33 |
|
16 |
| -(number) @constant.numeric |
| 34 | +[ |
| 35 | + "for" |
| 36 | + "while" |
| 37 | + (break) |
| 38 | + (continue) |
| 39 | +] @keyword.repeat |
17 | 40 |
|
18 |
| -((identifier) @constant.builtin.boolean |
19 |
| - (#any-of? @constant.builtin.boolean "true" "false")) |
| 41 | +"return" @keyword.return |
20 | 42 |
|
21 |
| -((identifier) @constant |
22 |
| - (#match? @constant "^[A-Z][A-Z\\d_]*$")) |
23 |
| - |
24 |
| -((identifier) @constant.builtin |
25 |
| - (#eq? @constant.builtin "null")) |
26 |
| - |
27 |
| -((identifier) @type |
28 |
| - (#any-of? @type |
29 |
| - "String" |
30 |
| - "Map" |
31 |
| - "Object" |
32 |
| - "Boolean" |
33 |
| - "Integer" |
34 |
| - "List")) |
35 |
| - |
36 |
| -((identifier) @function.builtin |
37 |
| - (#any-of? @function.builtin |
38 |
| - "void" |
39 |
| - "id" |
40 |
| - "version" |
41 |
| - "apply" |
42 |
| - "implementation" |
43 |
| - "testImplementation" |
44 |
| - "androidTestImplementation" |
45 |
| - "debugImplementation")) |
46 |
| - |
47 |
| -((identifier) @keyword.storage.modifier |
48 |
| - (#eq? @keyword.storage.modifier "static")) |
49 |
| - |
50 |
| -((identifier) @keyword.storage.type |
51 |
| - (#any-of? @keyword.storage.type "class" "def" "interface")) |
52 |
| - |
53 |
| -((identifier) @keyword |
54 |
| - (#any-of? @keyword |
55 |
| - "assert" |
56 |
| - "new" |
57 |
| - "extends" |
58 |
| - "implements" |
59 |
| - "instanceof")) |
60 |
| - |
61 |
| -((identifier) @keyword.control.import |
62 |
| - (#any-of? @keyword.control.import "import" "package")) |
63 |
| - |
64 |
| -((identifier) @keyword.storage.modifier |
65 |
| - (#any-of? @keyword.storage.modifier |
66 |
| - "abstract" |
67 |
| - "protected" |
68 |
| - "private" |
69 |
| - "public")) |
70 |
| - |
71 |
| -((identifier) @keyword.control.exception |
72 |
| - (#any-of? @keyword.control.exception |
73 |
| - "throw" |
74 |
| - "finally" |
75 |
| - "try" |
76 |
| - "catch")) |
| 43 | +[ |
| 44 | + "true" |
| 45 | + "false" |
| 46 | +] @boolean |
| 47 | + |
| 48 | +(null) @constant.builtin |
| 49 | + |
| 50 | +"this" @variable.builtin |
| 51 | + |
| 52 | +[ |
| 53 | + "int" |
| 54 | + "char" |
| 55 | + "short" |
| 56 | + "long" |
| 57 | + "boolean" |
| 58 | + "float" |
| 59 | + "double" |
| 60 | + "void" |
| 61 | +] @type.builtin |
| 62 | + |
| 63 | +[ |
| 64 | + "final" |
| 65 | + "private" |
| 66 | + "protected" |
| 67 | + "public" |
| 68 | + "static" |
| 69 | + "synchronized" |
| 70 | +] @type.qualifier |
| 71 | + |
| 72 | +(comment) @comment @spell |
| 73 | + |
| 74 | +(shebang) @keyword.directive |
77 | 75 |
|
78 | 76 | (string) @string
|
79 | 77 |
|
| 78 | +(string |
| 79 | + (escape_sequence) @string.escape) |
| 80 | + |
| 81 | +(string |
| 82 | + (interpolation |
| 83 | + "$" @punctuation.special)) |
| 84 | + |
| 85 | +[ |
| 86 | + "(" |
| 87 | + ")" |
| 88 | + "[" |
| 89 | + "]" |
| 90 | + "{" |
| 91 | + "}" |
| 92 | +] @punctuation.bracket |
| 93 | + |
80 | 94 | [
|
81 |
| - (line_comment) |
82 |
| - (block_comment) |
83 |
| -] @comment |
| 95 | + ":" |
| 96 | + "," |
| 97 | + "." |
| 98 | +] @punctuation.delimiter |
| 99 | + |
| 100 | +(number_literal) @number |
84 | 101 |
|
85 |
| -((block_comment) @comment.block.documentation |
86 |
| - (#match? @comment.block.documentation "^/[*][*][^*](?s:.)*[*]/$")) |
| 102 | +(identifier) @variable |
87 | 103 |
|
88 |
| -((line_comment) @comment.block.documentation |
89 |
| - (#match? @comment.block.documentation "^///[^/]*.*$")) |
| 104 | +((identifier) @constant |
| 105 | + (#match? @constant "^[A-Z][A-Z_]+")) |
90 | 106 |
|
91 | 107 | [
|
92 |
| - (operators) |
93 |
| - (leading_key) |
| 108 | + "%" |
| 109 | + "*" |
| 110 | + "/" |
| 111 | + "+" |
| 112 | + "-" |
| 113 | + "<<" |
| 114 | + ">>" |
| 115 | + ">>>" |
| 116 | + ".." |
| 117 | + "..<" |
| 118 | + "<..<" |
| 119 | + "<.." |
| 120 | + "<" |
| 121 | + "<=" |
| 122 | + ">" |
| 123 | + ">=" |
| 124 | + "==" |
| 125 | + "!=" |
| 126 | + "<=>" |
| 127 | + "===" |
| 128 | + "!==" |
| 129 | + "=~" |
| 130 | + "==~" |
| 131 | + "&" |
| 132 | + "^" |
| 133 | + "|" |
| 134 | + "&&" |
| 135 | + "||" |
| 136 | + "?:" |
| 137 | + "+" |
| 138 | + "*" |
| 139 | + ".&" |
| 140 | + ".@" |
| 141 | + "?." |
| 142 | + "*." |
| 143 | + "*" |
| 144 | + "*:" |
| 145 | + "++" |
| 146 | + "--" |
| 147 | + "!" |
94 | 148 | ] @operator
|
95 | 149 |
|
96 |
| -["(" ")" "[" "]" "{" "}"] @punctuation.bracket |
| 150 | +(string |
| 151 | + "/" @string) |
| 152 | + |
| 153 | +(ternary_op |
| 154 | + ([ |
| 155 | + "?" |
| 156 | + ":" |
| 157 | + ]) @keyword.conditional.ternary) |
| 158 | + |
| 159 | +(map |
| 160 | + (map_item |
| 161 | + key: (identifier) @variable.parameter)) |
| 162 | + |
| 163 | +(parameter |
| 164 | + type: (identifier) @type |
| 165 | + name: (identifier) @variable.parameter) |
| 166 | + |
| 167 | +(generic_param |
| 168 | + name: (identifier) @variable.parameter) |
| 169 | + |
| 170 | +(declaration |
| 171 | + type: (identifier) @type) |
| 172 | + |
| 173 | +(function_definition |
| 174 | + type: (identifier) @type) |
| 175 | + |
| 176 | +(function_declaration |
| 177 | + type: (identifier) @type) |
| 178 | + |
| 179 | +(class_definition |
| 180 | + name: (identifier) @type) |
| 181 | + |
| 182 | +(class_definition |
| 183 | + superclass: (identifier) @type) |
| 184 | + |
| 185 | +(generic_param |
| 186 | + superclass: (identifier) @type) |
| 187 | + |
| 188 | +(type_with_generics |
| 189 | + (identifier) @type) |
| 190 | + |
| 191 | +(type_with_generics |
| 192 | + (generics |
| 193 | + (identifier) @type)) |
| 194 | + |
| 195 | +(generics |
| 196 | + [ |
| 197 | + "<" |
| 198 | + ">" |
| 199 | + ] @punctuation.bracket) |
| 200 | + |
| 201 | +(generic_parameters |
| 202 | + [ |
| 203 | + "<" |
| 204 | + ">" |
| 205 | + ] @punctuation.bracket) |
| 206 | + |
| 207 | +; TODO: Class literals with PascalCase |
| 208 | +(declaration |
| 209 | + "=" @operator) |
| 210 | + |
| 211 | +(assignment |
| 212 | + "=" @operator) |
| 213 | + |
| 214 | +(function_call |
| 215 | + function: (identifier) @function) |
| 216 | + |
| 217 | +(function_call |
| 218 | + function: |
| 219 | + (dotted_identifier |
| 220 | + (identifier) @function .)) |
| 221 | + |
| 222 | +(function_call |
| 223 | + (argument_list |
| 224 | + (map_item |
| 225 | + key: (identifier) @variable.parameter))) |
| 226 | + |
| 227 | +(juxt_function_call |
| 228 | + function: (identifier) @function) |
| 229 | + |
| 230 | +(juxt_function_call |
| 231 | + function: |
| 232 | + (dotted_identifier |
| 233 | + (identifier) @function .)) |
| 234 | + |
| 235 | +(juxt_function_call |
| 236 | + (argument_list |
| 237 | + (map_item |
| 238 | + key: (identifier) @variable.parameter))) |
| 239 | + |
| 240 | +(function_definition |
| 241 | + function: (identifier) @function) |
| 242 | + |
| 243 | +(function_declaration |
| 244 | + function: (identifier) @function) |
| 245 | + |
| 246 | +(annotation) @function.macro |
| 247 | + |
| 248 | +(annotation |
| 249 | + (identifier) @function.macro) |
| 250 | + |
| 251 | +"@interface" @function.macro |
| 252 | + |
| 253 | +(groovy_doc) @comment.documentation @spell |
| 254 | + |
| 255 | +(groovy_doc |
| 256 | + [ |
| 257 | + (groovy_doc_param) |
| 258 | + (groovy_doc_throws) |
| 259 | + (groovy_doc_tag) |
| 260 | + ] @string.special @nospell) |
| 261 | + |
| 262 | +(groovy_doc |
| 263 | + (groovy_doc_param |
| 264 | + (identifier) @variable.parameter) @nospell) |
| 265 | + |
| 266 | +(groovy_doc |
| 267 | + (groovy_doc_throws |
| 268 | + (identifier) @type @nospell)) |
0 commit comments