| 1 |
|
| 2 |
|
| 3 |
(package_identifier) @namespace |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
(positional_parameter (lowercase_identifier) @variable.parameter) |
| 8 |
(labelled_parameter (label (lowercase_identifier)) @variable.parameter) |
| 9 |
(optional_parameter (optional_label (lowercase_identifier)) @variable.parameter) |
| 10 |
(optional_parameter_with_default (label (lowercase_identifier)) @variable.parameter) |
| 11 |
((positional_parameter (lowercase_identifier) @variable.builtin) |
| 12 |
(#any-of? @variable.builtin "self")) |
| 13 |
((labelled_parameter (label (lowercase_identifier)) @variable.builtin) |
| 14 |
(#any-of? @variable.builtin "self")) |
| 15 |
((optional_parameter (optional_label (lowercase_identifier)) @variable.builtin) |
| 16 |
(#any-of? @variable.builtin "self")) |
| 17 |
((optional_parameter_with_default (label (lowercase_identifier)) @variable.builtin) |
| 18 |
(#any-of? @variable.builtin "self")) |
| 19 |
|
| 20 |
(tuple_pattern (lowercase_identifier) @variable) |
| 21 |
(constructor_pattern_argument . (lowercase_identifier) @variable .) |
| 22 |
(constructor_pattern_argument "=" (lowercase_identifier) @variable) |
| 23 |
(constructor_pattern_argument (label (lowercase_identifier) @variable)) |
| 24 |
(case_clause (lowercase_identifier) @variable "=>") |
| 25 |
(matrix_case_clause (lowercase_identifier) @variable "=>") |
| 26 |
(let_expression (lowercase_identifier) @variable) |
| 27 |
|
| 28 |
(qualified_identifier (lowercase_identifier) @variable) |
| 29 |
((qualified_identifier (lowercase_identifier) @variable.builtin) |
| 30 |
(#any-of? @variable.builtin "self")) |
| 31 |
(qualified_identifier (dot_lowercase_identifier) @variable) |
| 32 |
|
| 33 |
(value_definition (lowercase_identifier) @variable) |
| 34 |
(let_mut_expression (lowercase_identifier) @variable) |
| 35 |
(for_in_expression "for" (lowercase_identifier) @variable "in") |
| 36 |
(for_binder (lowercase_identifier) @variable) |
| 37 |
(package_statement_identifier) @variable |
| 38 |
(package_assignment_statement |
| 39 |
name: (package_statement_identifier) @variable) |
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
(enum_constructor) @constructor |
| 44 |
(constructor_expression (uppercase_identifier) @constructor) |
| 45 |
(constructor_expression (dot_uppercase_identifier) @constructor) |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
(const_definition (uppercase_identifier) @constant) |
| 50 |
((constructor_expression (uppercase_identifier) @constant) |
| 51 |
(#match? @constant "^[A-Z][A-Z_]+$")) |
| 52 |
((constructor_expression (dot_uppercase_identifier) @constant) |
| 53 |
(#match? @constant "^\.[A-Z][A-Z_]+$")) |
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
(type_identifier) @type |
| 58 |
(qualified_type_identifier) @type |
| 59 |
|
| 60 |
(enum_definition (identifier) @type) |
| 61 |
(struct_definition (identifier) @type) |
| 62 |
(tuple_struct_definition (identifier) @type) |
| 63 |
(type_definition (identifier) @type) |
| 64 |
(trait_definition (identifier) @type) |
| 65 |
(type_alias_targets (identifier) @type) |
| 66 |
(type_alias_targets (dot_identifier) @type) |
| 67 |
(type_alias_target (identifier) @type) |
| 68 |
(error_type_definition (identifier) @type) |
| 69 |
(trait_alias_targets (identifier) @type) |
| 70 |
(trait_alias_targets (dot_identifier) @type) |
| 71 |
(trait_alias_target (identifier) @type) |
| 72 |
|
| 73 |
((qualified_type_identifier) @type.builtin |
| 74 |
(#any-of? @type.builtin |
| 75 |
"Unit" "Bool" "Byte" |
| 76 |
"Int16" "UInt16" "Int" "UInt" "Int64" "UInt64" |
| 77 |
"Float" "Double" |
| 78 |
"FixedArray" "Array" "Bytes" "String" "Error" "Self")) |
| 79 |
|
| 80 |
((qualified_type_identifier) @type.builtin |
| 81 |
(#any-of? @type.builtin |
| 82 |
"Eq" "Compare" "Hash" "Show" "Default" "ToJson" "FromJson")) |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
(struct_field_declaration (lowercase_identifier) @variable.other.member) |
| 87 |
(struct_expression (labeled_expression (lowercase_identifier) @variable.other.member)) |
| 88 |
(struct_expression (labeled_expression_pun (lowercase_identifier) @variable.other.member)) |
| 89 |
(struct_field_expression (labeled_expression (lowercase_identifier) @variable.other.member)) |
| 90 |
(struct_field_expression (labeled_expression_pun (lowercase_identifier) @variable.other.member)) |
| 91 |
(struct_pattern (struct_field_pattern (labeled_pattern (lowercase_identifier) @variable.other.member))) |
| 92 |
(struct_pattern (struct_field_pattern (labeled_pattern_pun (lowercase_identifier) @variable.other.member))) |
| 93 |
(access_expression (accessor (dot_identifier) @variable.other.member)) |
| 94 |
(constructor_pattern_argument (lowercase_identifier) @variable.other.member "=") |
| 95 |
(apply_expression (constructor_expression) (arguments (argument (labelled_argument (lowercase_identifier) @variable.other.member "=")))) |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
(attribute) @attribute |
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
(apply_expression (qualified_identifier (lowercase_identifier) @function)) |
| 104 |
(apply_expression (qualified_identifier (dot_lowercase_identifier) @function)) |
| 105 |
(package_apply_statement |
| 106 |
name: (package_statement_identifier) @function) |
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
(method_expression (lowercase_identifier) @function.method) |
| 111 |
(dot_apply_expression (dot_identifier) @function.method) |
| 112 |
(dot_dot_apply_expression (dot_dot_identifier) @function.method) |
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
(function_definition (function_identifier (lowercase_identifier) @function)) |
| 117 |
(struct_constructor_declaration (lowercase_identifier) @function) |
| 118 |
(function_alias_targets (lowercase_identifier) @function) |
| 119 |
(function_alias_targets (dot_lowercase_identifier) @function) |
| 120 |
(function_alias_target (lowercase_identifier) @function) |
| 121 |
(trait_method_declaration (function_identifier) @function) |
| 122 |
(impl_definition (function_identifier) @function) |
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
(function_definition (function_identifier (type_name (qualified_type_identifier)) (lowercase_identifier) @function.method)) |
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
(loop_label) @label |
| 131 |
("continue" (label) @label) |
| 132 |
("break" (label) @label) |
| 133 |
(package_argument |
| 134 |
label: (package_statement_identifier) @label) |
| 135 |
(package_argument |
| 136 |
label: (string_literal) @label) |
| 137 |
(package_map_entry |
| 138 |
key: (string_literal) @label) |
| 139 |
(where_clause_field (lowercase_identifier) @label) |
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
[ |
| 144 |
"+" "-" "*" "/" "%" |
| 145 |
"<<" ">>" "|" "&" "^" |
| 146 |
"=" "+=" "-=" "*=" "/=" "%=" |
| 147 |
"<" ">" ">=" "<=" "==" "!=" |
| 148 |
"&&" "||" |
| 149 |
"|>" |
| 150 |
"=>" "->" |
| 151 |
"!" "!!" "?" |
| 152 |
] @operator |
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
[ (mutability) "mut" ] @keyword.storage.modifier |
| 157 |
|
| 158 |
[ |
| 159 |
"struct" "enum" "type" "trait" "typealias" "traitalias" "suberror" |
| 160 |
] @keyword.storage.type |
| 161 |
|
| 162 |
[ |
| 163 |
"pub" "priv" "readonly" "all" "open" "extern" |
| 164 |
] @keyword.storage.modifier |
| 165 |
|
| 166 |
[ |
| 167 |
"guard" "let" "letrec" "and" "const" |
| 168 |
"with" "as" "is" "lexmatch?" "using" "where" "longest" "nobreak" |
| 169 |
"defer" |
| 170 |
] @keyword |
| 171 |
|
| 172 |
"derive" @keyword |
| 173 |
|
| 174 |
[ "package" "import" ] @keyword.control.import |
| 175 |
|
| 176 |
[ "fn" "test" "impl" "fnalias" ] @keyword.function |
| 177 |
"return" @keyword.control.return |
| 178 |
[ "while" "loop" "for" "break" "continue" "in" ] @keyword.control.repeat |
| 179 |
|
| 180 |
[ |
| 181 |
"if" |
| 182 |
"else" |
| 183 |
"match" |
| 184 |
] @keyword.control.conditional |
| 185 |
|
| 186 |
"async" @keyword |
| 187 |
|
| 188 |
[ "try" "raise" "catch" "noraise" ] @keyword.control.exception |
| 189 |
|
| 190 |
((lowercase_identifier) @keyword |
| 191 |
(#any-of? @keyword |
| 192 |
"import" "using" |
| 193 |
"proof_assert" "proof_let" |
| 194 |
"defer" "lexmatch" "recur")) |
| 195 |
|
| 196 |
((lowercase_identifier) @keyword.control.exception |
| 197 |
(#eq? @keyword.control.exception "except")) |
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
[ |
| 202 |
";" |
| 203 |
"," |
| 204 |
] @punctuation.delimiter |
| 205 |
|
| 206 |
":" @punctuation.delimiter |
| 207 |
"::" @punctuation.delimiter |
| 208 |
"." @punctuation.delimiter |
| 209 |
".." @punctuation.delimiter |
| 210 |
|
| 211 |
(array_sub_pattern "..") @operator |
| 212 |
(dot_dot_apply_expression (dot_dot_identifier ".." @punctuation.delimiter)) |
| 213 |
|
| 214 |
[ |
| 215 |
"..<" |
| 216 |
"..=" |
| 217 |
"..<=" |
| 218 |
"..>" |
| 219 |
"..>=" |
| 220 |
] @operator |
| 221 |
|
| 222 |
[ |
| 223 |
"(" ")" |
| 224 |
"{" "}" |
| 225 |
"[" "]" |
| 226 |
] @punctuation.bracket |
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
(string_interpolation) @string |
| 231 |
(string_literal) @string |
| 232 |
(multiline_string_literal) @string |
| 233 |
(escape_sequence) @constant.character.escape |
| 234 |
|
| 235 |
(interpolator |
| 236 |
"\\{" @punctuation.special |
| 237 |
"}" @punctuation.special) |
| 238 |
|
| 239 |
(integer_literal) @constant.numeric.integer |
| 240 |
(float_literal) @constant.numeric.float |
| 241 |
(boolean_literal) @constant.builtin.boolean |
| 242 |
(char_literal) @constant.character |
| 243 |
|
| 244 |
|
| 245 |
|
| 246 |
(comment) @comment |
| 247 |
(block_comment) @comment.block |
| 248 |
|
| 249 |
|
| 250 |
|
| 251 |
(ERROR) @error |