summaryrefslogtreecommitdiffstats
path: root/queries/python
diff options
context:
space:
mode:
authorAmaan Qureshi <amaanq12@gmail.com>2023-04-21 04:06:20 -0400
committerAmaan Qureshi <amaanq12@gmail.com>2023-04-21 18:24:17 -0400
commit85330918f05b3a4bd342a69063e7ef5fcdfadd2e (patch)
tree6b38f8e3af9ad1079ba94ffc7056263b056d0c00 /queries/python
parentfix(c): types are optional in sized_type_specifier (diff)
downloadnvim-treesitter-85330918f05b3a4bd342a69063e7ef5fcdfadd2e.tar
nvim-treesitter-85330918f05b3a4bd342a69063e7ef5fcdfadd2e.tar.gz
nvim-treesitter-85330918f05b3a4bd342a69063e7ef5fcdfadd2e.tar.bz2
nvim-treesitter-85330918f05b3a4bd342a69063e7ef5fcdfadd2e.tar.lz
nvim-treesitter-85330918f05b3a4bd342a69063e7ef5fcdfadd2e.tar.xz
nvim-treesitter-85330918f05b3a4bd342a69063e7ef5fcdfadd2e.tar.zst
nvim-treesitter-85330918f05b3a4bd342a69063e7ef5fcdfadd2e.zip
perf: remove match where possible
Diffstat (limited to 'queries/python')
-rw-r--r--queries/python/highlights.scm12
1 files changed, 6 insertions, 6 deletions
diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm
index 86cb46b5a..30747b1fa 100644
--- a/queries/python/highlights.scm
+++ b/queries/python/highlights.scm
@@ -29,7 +29,7 @@
((attribute
attribute: (identifier) @field)
- (#match? @field "^([A-Z])@!.*$"))
+ (#lua-match? @field "^%u@!.*$"))
((identifier) @type.builtin
(#any-of? @type.builtin
@@ -71,12 +71,12 @@
((call
function: (identifier) @constructor)
- (#lua-match? @constructor "^[A-Z]"))
+ (#lua-match? @constructor "^%u"))
((call
function: (attribute
attribute: (identifier) @constructor))
- (#lua-match? @constructor "^[A-Z]"))
+ (#lua-match? @constructor "^%u"))
;; Decorators
@@ -170,7 +170,7 @@
(comment) @comment @spell
((module . (comment) @preproc)
- (#match? @preproc "^#!/"))
+ (#lua-match? @preproc "^#!/"))
(string) @string
(escape_sequence) @string.escape
@@ -324,14 +324,14 @@
(expression_statement
(assignment
left: (identifier) @field))))
- (#match? @field "^([A-Z])@!.*$"))
+ (#lua-match? @field "^%u@!.*$"))
((class_definition
body: (block
(expression_statement
(assignment
left: (_
(identifier) @field)))))
- (#match? @field "^([A-Z])@!.*$"))
+ (#lua-match? @field "^%u@!.*$"))
((class_definition
(block