highlights(swift): add more @operators and implicit keyword

This commit is contained in:
Stephan Seitz 2022-01-16 15:36:02 +01:00
parent 8025b90329
commit cc1890528f
2 changed files with 25 additions and 1 deletions

View file

@ -29,7 +29,15 @@
(inheritance_constraint (identifier (simple_identifier) @parameter))
(equality_constraint (identifier (simple_identifier) @parameter))
["typealias" "struct" "class" "enum" "protocol" "extension"] @keyword
[
"typealias"
"struct"
"class"
"enum"
"protocol"
"extension"
"indirect"
] @keyword
(class_body (property_declaration (value_binding_pattern (non_binding_pattern (simple_identifier) @property))))
(protocol_property_declaration (value_binding_pattern (non_binding_pattern (simple_identifier) @property)))
@ -69,6 +77,8 @@
(switch_entry ["fallthrough" @keyword])
(switch_entry (default_keyword) @keyword)
"return" @keyword.return
(ternary_expression
["?" ":"] @conditional)
["do" (throw_keyword) (catch_keyword)] @keyword
@ -129,6 +139,12 @@
"%="
"!="
"!=="
"=="
"==="
"??"
"->"
"..<"
"..."
] @operator

View file

@ -0,0 +1,8 @@
for i in 0..<5 {
// ^ operator
print(i)
}
for i in 0...5 {
// ^ operator
print(i)
}