aboutsummaryrefslogtreecommitdiffstats
path: root/queries/python
diff options
context:
space:
mode:
Diffstat (limited to 'queries/python')
-rw-r--r--queries/python/highlights.scm84
1 files changed, 42 insertions, 42 deletions
diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm
index d0759e26b..60f3e14c0 100644
--- a/queries/python/highlights.scm
+++ b/queries/python/highlights.scm
@@ -35,48 +35,6 @@
function: (identifier) @_func))
(#any-of? @_func "TypeVar" "NewType"))
-; Function calls
-(call
- function: (identifier) @function.call)
-
-(call
- function: (attribute
- attribute: (identifier) @function.method.call))
-
-((call
- function: (identifier) @constructor)
- (#lua-match? @constructor "^%u"))
-
-((call
- function: (attribute
- attribute: (identifier) @constructor))
- (#lua-match? @constructor "^%u"))
-
-; Decorators
-((decorator
- "@" @attribute)
- (#set! priority 101))
-
-(decorator
- (identifier) @attribute)
-
-(decorator
- (attribute
- attribute: (identifier) @attribute))
-
-(decorator
- (call
- (identifier) @attribute))
-
-(decorator
- (call
- (attribute
- attribute: (identifier) @attribute)))
-
-((decorator
- (identifier) @attribute.builtin)
- (#any-of? @attribute.builtin "classmethod" "property" "staticmethod"))
-
; Builtin functions
((call
function: (identifier) @function.builtin)
@@ -450,6 +408,23 @@
name: (identifier) @constructor)))
(#any-of? @constructor "__new__" "__init__"))
+; Function calls
+(call
+ function: (identifier) @function.call)
+
+(call
+ function: (attribute
+ attribute: (identifier) @function.method.call))
+
+((call
+ function: (identifier) @constructor)
+ (#lua-match? @constructor "^%u"))
+
+((call
+ function: (attribute
+ attribute: (identifier) @constructor))
+ (#lua-match? @constructor "^%u"))
+
; Regex from the `re` module
(call
function: (attribute
@@ -459,3 +434,28 @@
(string
(string_content) @string.regexp))
(#eq? @_re "re"))
+
+; Decorators
+((decorator
+ "@" @attribute)
+ (#set! priority 101))
+
+(decorator
+ (identifier) @attribute)
+
+(decorator
+ (attribute
+ attribute: (identifier) @attribute))
+
+(decorator
+ (call
+ (identifier) @attribute))
+
+(decorator
+ (call
+ (attribute
+ attribute: (identifier) @attribute)))
+
+((decorator
+ (identifier) @attribute.builtin)
+ (#any-of? @attribute.builtin "classmethod" "property" "staticmethod"))