Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/swift/highlights.scm')
-rw-r--r--runtime/queries/swift/highlights.scm90
1 files changed, 43 insertions, 47 deletions
diff --git a/runtime/queries/swift/highlights.scm b/runtime/queries/swift/highlights.scm
index ecafde40..42411d90 100644
--- a/runtime/queries/swift/highlights.scm
+++ b/runtime/queries/swift/highlights.scm
@@ -4,50 +4,9 @@
["\\(" ")"] @punctuation.special)
["." ";" ":" "," ] @punctuation.delimiter
-["(" ")" "[" "]" "{" "}" "<" ">"] @punctuation.bracket
-
-; Operators
-[
- "!"
- "?"
- "+"
- "-"
- "\\"
- "*"
- "/"
- "%"
- "="
- "+="
- "-="
- "*="
- "/="
- "<"
- ">"
- "<="
- ">="
- "++"
- "--"
- "&"
- "~"
- "%="
- "!="
- "!=="
- "=="
- "==="
- "??"
-
- "->"
-
- "..<"
- "..."
- (custom_operator)
-] @operator
-
-"?" @type
-(type_annotation "!" @type)
+["(" ")" "[" "]" "{" "}"] @punctuation.bracket
; Identifiers
-(simple_identifier) @variable
(attribute) @variable
(type_identifier) @type
(self_expression) @variable.builtin
@@ -65,7 +24,6 @@
] @keyword
(function_declaration (simple_identifier) @function.method)
-(protocol_function_declaration (simple_identifier) @function.method)
(init_declaration ["init" @constructor])
(deinit_declaration ["deinit" @constructor])
@@ -133,9 +91,6 @@
(#match? @type "^[A-Z]"))
(call_expression (simple_identifier) @keyword (#eq? @keyword "defer")) ; defer { ... }
-(navigation_suffix
- (simple_identifier) @variable.other.member)
-
(try_operator) @operator
(try_operator ["try" @keyword])
@@ -192,7 +147,48 @@
(integer_literal) @constant.numeric.integer
(real_literal) @constant.numeric.float
(boolean_literal) @constant.builtin.boolean
-"nil" @constant.builtin
+"nil" @variable.builtin
+
+"?" @type
+(type_annotation "!" @type)
+
+(simple_identifier) @variable
+
+; Operators
+[
+ "!"
+ "?"
+ "+"
+ "-"
+ "*"
+ "/"
+ "%"
+ "="
+ "+="
+ "-="
+ "*="
+ "/="
+ "<"
+ ">"
+ "<="
+ ">="
+ "++"
+ "--"
+ "&"
+ "~"
+ "%="
+ "!="
+ "!=="
+ "=="
+ "==="
+ "??"
+
+ "->"
+
+ "..<"
+ "..."
+ (custom_operator)
+] @operator
(value_parameter_pack ["each" @keyword])
(value_pack_expansion ["repeat" @keyword])