mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 11:50:09 -04:00
Prefer lua-match over match
as string.find is much quicker than vim.regex:match*
This commit is contained in:
parent
89fbb9b39e
commit
011ac894ec
20 changed files with 67 additions and 67 deletions
|
|
@ -6,7 +6,7 @@
|
|||
(#match? @tag "^(:)?[a-z]"))
|
||||
; Tags that start with a capital letter are Glimmer components
|
||||
((tag_name) @constructor
|
||||
(#match? @constructor "^[A-Z]"))
|
||||
(#lua-match? @constructor "^[A-Z]"))
|
||||
|
||||
(attribute_name) @property
|
||||
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
(block_statement_start path: (identifier) @conditional)
|
||||
(block_statement_end path: (identifier) @conditional)
|
||||
((mustache_statement (identifier) @conditional)
|
||||
(#match? @conditional "else"))
|
||||
(#lua-match? @conditional "else"))
|
||||
|
||||
; == Mustache Statements ===
|
||||
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
(#not-match? @variable "this"))
|
||||
; `this` should be highlighted as a built-in variable
|
||||
((identifier) @variable.builtin
|
||||
(#match? @variable.builtin "this"))
|
||||
(#lua-match? @variable.builtin "this"))
|
||||
|
||||
; If the identifier is just "yield" or "outlet", it's a keyword
|
||||
((mustache_statement (identifier) @keyword)
|
||||
|
|
@ -67,9 +67,9 @@
|
|||
])
|
||||
(#not-match? @function "if|yield"))
|
||||
((helper_invocation helper: (identifier) @conditional)
|
||||
(#match? @conditional "if"))
|
||||
(#lua-match? @conditional "if"))
|
||||
((helper_invocation helper: (identifier) @keyword)
|
||||
(#match? @keyword "yield"))
|
||||
(#lua-match? @keyword "yield"))
|
||||
|
||||
(hash_pair key: (identifier) @property)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue