| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
(throws_clause) @keyword |
| 10 |
|
| 11 |
(line_string_literal |
| 12 |
["\\(" ")"] @punctuation.special) |
| 13 |
|
| 14 |
["." ";" ":" "," ] @punctuation.delimiter |
| 15 |
["(" ")" "[" "]" "{" "}" "<" ">"] @punctuation.bracket |
| 16 |
|
| 17 |
|
| 18 |
[ |
| 19 |
"!" |
| 20 |
"?" |
| 21 |
"+" |
| 22 |
"-" |
| 23 |
"\\" |
| 24 |
"*" |
| 25 |
"/" |
| 26 |
"%" |
| 27 |
"=" |
| 28 |
"+=" |
| 29 |
"-=" |
| 30 |
"*=" |
| 31 |
"/=" |
| 32 |
"<" |
| 33 |
">" |
| 34 |
"<=" |
| 35 |
">=" |
| 36 |
"++" |
| 37 |
"--" |
| 38 |
"&" |
| 39 |
"~" |
| 40 |
"%=" |
| 41 |
"!=" |
| 42 |
"!==" |
| 43 |
"==" |
| 44 |
"===" |
| 45 |
"??" |
| 46 |
|
| 47 |
"->" |
| 48 |
|
| 49 |
"..<" |
| 50 |
"..." |
| 51 |
(custom_operator) |
| 52 |
] @operator |
| 53 |
|
| 54 |
"?" @type |
| 55 |
(type_annotation "!" @type) |
| 56 |
|
| 57 |
|
| 58 |
(simple_identifier) @variable |
| 59 |
(attribute) @variable |
| 60 |
(type_identifier) @type |
| 61 |
(self_expression) @variable.builtin |
| 62 |
(user_type (type_identifier) @variable.builtin (#eq? @variable.builtin "Self")) |
| 63 |
|
| 64 |
|
| 65 |
"func" @keyword.function |
| 66 |
[ |
| 67 |
(visibility_modifier) |
| 68 |
(member_modifier) |
| 69 |
(function_modifier) |
| 70 |
(property_modifier) |
| 71 |
(parameter_modifier) |
| 72 |
(inheritance_modifier) |
| 73 |
] @keyword |
| 74 |
|
| 75 |
(function_declaration (simple_identifier) @function.method) |
| 76 |
(protocol_function_declaration (simple_identifier) @function.method) |
| 77 |
(init_declaration ["init" @constructor]) |
| 78 |
(deinit_declaration ["deinit" @constructor]) |
| 79 |
|
| 80 |
(throws) @keyword |
| 81 |
"async" @keyword |
| 82 |
"await" @keyword |
| 83 |
(where_keyword) @keyword |
| 84 |
(parameter external_name: (simple_identifier) @variable.parameter) |
| 85 |
(parameter name: (simple_identifier) @variable.parameter) |
| 86 |
(type_parameter (type_identifier) @variable.parameter) |
| 87 |
(inheritance_constraint (identifier (simple_identifier) @variable.parameter)) |
| 88 |
(equality_constraint (identifier (simple_identifier) @variable.parameter)) |
| 89 |
(pattern bound_identifier: (simple_identifier)) @variable |
| 90 |
|
| 91 |
[ |
| 92 |
"typealias" |
| 93 |
"struct" |
| 94 |
"class" |
| 95 |
"actor" |
| 96 |
"enum" |
| 97 |
"protocol" |
| 98 |
"extension" |
| 99 |
"indirect" |
| 100 |
"nonisolated" |
| 101 |
"override" |
| 102 |
"convenience" |
| 103 |
"required" |
| 104 |
"mutating" |
| 105 |
"associatedtype" |
| 106 |
"package" |
| 107 |
"any" |
| 108 |
] @keyword |
| 109 |
|
| 110 |
(opaque_type ["some" @keyword]) |
| 111 |
(existential_type ["any" @keyword]) |
| 112 |
|
| 113 |
(precedence_group_declaration |
| 114 |
["precedencegroup" @keyword] |
| 115 |
(simple_identifier) @type) |
| 116 |
(precedence_group_attribute |
| 117 |
(simple_identifier) @keyword |
| 118 |
[(simple_identifier) @type |
| 119 |
(boolean_literal) @constant.builtin.boolean]) |
| 120 |
|
| 121 |
[ |
| 122 |
(getter_specifier) |
| 123 |
(setter_specifier) |
| 124 |
(modify_specifier) |
| 125 |
] @keyword |
| 126 |
|
| 127 |
(class_body (property_declaration (pattern (simple_identifier) @variable.other.member))) |
| 128 |
(protocol_property_declaration (pattern (simple_identifier) @variable.other.member)) |
| 129 |
|
| 130 |
(import_declaration "import" @keyword.control.import) |
| 131 |
|
| 132 |
(enum_entry "case" @keyword) |
| 133 |
|
| 134 |
|
| 135 |
(navigation_suffix |
| 136 |
(simple_identifier) @variable.other.member) |
| 137 |
|
| 138 |
|
| 139 |
(call_expression (simple_identifier) @function) |
| 140 |
(call_expression |
| 141 |
(navigation_expression |
| 142 |
(navigation_suffix (simple_identifier) @function))) |
| 143 |
((navigation_expression |
| 144 |
(simple_identifier) @type) |
| 145 |
(#match? @type "^[A-Z]")) |
| 146 |
(call_expression (simple_identifier) @keyword (#eq? @keyword "defer")) |
| 147 |
|
| 148 |
(try_operator) @operator |
| 149 |
(try_operator ["try" @keyword]) |
| 150 |
|
| 151 |
(directive) @function.macro |
| 152 |
(diagnostic) @function.macro |
| 153 |
|
| 154 |
.` |
| 155 |
|
| 156 |
(macro_invocation . (simple_identifier) @function.macro) |
| 157 |
…)`. |
| 158 |
(playground_literal |
| 159 |
["colorLiteral" "fileLiteral" "imageLiteral"] @function.macro) |
| 160 |
|
| 161 |
|
| 162 |
(for_statement "for" @keyword.control.repeat) |
| 163 |
(for_statement "in" @keyword.control.repeat) |
| 164 |
r` |
| 165 |
|
| 166 |
e, |
| 167 |
|
| 168 |
(else) @keyword |
| 169 |
(as_operator) @keyword |
| 170 |
|
| 171 |
["while" "repeat" "continue" "break"] @keyword.control.repeat |
| 172 |
|
| 173 |
["let" "var"] @keyword |
| 174 |
|
| 175 |
(guard_statement "guard" @keyword.control.conditional) |
| 176 |
(if_statement "if" @keyword.control.conditional) |
| 177 |
(switch_statement "switch" @keyword.control.conditional) |
| 178 |
(switch_entry "case" @keyword.control.conditional) |
| 179 |
(switch_entry "fallthrough" @keyword.control.conditional) |
| 180 |
(switch_entry (default_keyword) @keyword.control.conditional) |
| 181 |
"return" @keyword.control.return |
| 182 |
(ternary_expression |
| 183 |
["?" ":"] @keyword.control.conditional) |
| 184 |
|
| 185 |
["do" (throw_keyword) (catch_keyword)] @keyword.control.exception |
| 186 |
|
| 187 |
(statement_label) @label |
| 188 |
|
| 189 |
|
| 190 |
(comment) @comment |
| 191 |
(multiline_comment) @comment |
| 192 |
|
| 193 |
|
| 194 |
(line_str_text) @string |
| 195 |
(str_escaped_char) @string |
| 196 |
(multi_line_str_text) @string |
| 197 |
(raw_str_part) @string |
| 198 |
(raw_str_end_part) @string |
| 199 |
(raw_str_interpolation_start) @punctuation.special |
| 200 |
["\"" "\"\"\""] @string |
| 201 |
|
| 202 |
|
| 203 |
(lambda_literal "in" @keyword.operator) |
| 204 |
|
| 205 |
|
| 206 |
[ |
| 207 |
(hex_literal) |
| 208 |
(oct_literal) |
| 209 |
(bin_literal) |
| 210 |
] @constant.numeric |
| 211 |
(integer_literal) @constant.numeric.integer |
| 212 |
(real_literal) @constant.numeric.float |
| 213 |
(boolean_literal) @constant.builtin.boolean |
| 214 |
"nil" @constant.builtin |
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
(special_literal) @constant.builtin |
| 219 |
|
| 220 |
(value_parameter_pack ["each" @keyword]) |
| 221 |
(value_pack_expansion ["repeat" @keyword]) |
| 222 |
(type_parameter_pack ["each" @keyword]) |
| 223 |
(type_pack_expansion ["repeat" @keyword]) |