aboutsummaryrefslogtreecommitdiffstats
path: root/queries/glimmer
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/glimmer
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/glimmer')
-rw-r--r--queries/glimmer/highlights.scm16
1 files changed, 8 insertions, 8 deletions
diff --git a/queries/glimmer/highlights.scm b/queries/glimmer/highlights.scm
index b1b3f9141..70a48cf83 100644
--- a/queries/glimmer/highlights.scm
+++ b/queries/glimmer/highlights.scm
@@ -3,10 +3,10 @@
; Tags that start with a lower case letter are HTML tags
; We'll also use this highlighting for named blocks (which start with `:`)
((tag_name) @tag
- (#match? @tag "^(:)?[a-z]"))
+ (#lua-match? @tag "^:?[%l]"))
; Tags that start with a capital letter are Glimmer components
((tag_name) @constructor
- (#lua-match? @constructor "^[A-Z]"))
+ (#lua-match? @constructor "^%u"))
(attribute_name) @property
@@ -38,7 +38,7 @@
(path_expression (identifier) @variable)
(identifier) @variable
])
- (#not-match? @variable "yield|outlet|this|else"))
+ (#not-any-of? @variable "yield" "outlet" "this" "else"))
; As are arguments in a block statement
(block_statement_start argument: [
(path_expression (identifier) @variable)
@@ -51,10 +51,10 @@
(path_expression (identifier) @variable)
(identifier) @variable
])
- (#not-match? @variable "this"))
+ (#not-eq? @variable "this"))
; `this` should be highlighted as a built-in variable
((identifier) @variable.builtin
- (#lua-match? @variable.builtin "this"))
+ (#eq? @variable.builtin "this"))
; If the identifier is just "yield" or "outlet", it's a keyword
((mustache_statement (identifier) @keyword)
@@ -65,11 +65,11 @@
(path_expression (identifier) @function)
(identifier) @function
])
- (#not-match? @function "if|yield"))
+ (#not-any-of? @function "if" "yield"))
((helper_invocation helper: (identifier) @conditional)
- (#lua-match? @conditional "if"))
+ (#eq? @conditional "if"))
((helper_invocation helper: (identifier) @keyword)
- (#lua-match? @keyword "yield"))
+ (#eq? @keyword "yield"))
(hash_pair key: (identifier) @property)