mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-12 16:30:02 -04:00
perf: remove match where possible
This commit is contained in:
parent
654216eb04
commit
85330918f0
37 changed files with 104 additions and 113 deletions
|
|
@ -23,16 +23,11 @@
|
|||
directive: (identifier)* @conditional
|
||||
argument: (identifier)* @namespace
|
||||
)
|
||||
(
|
||||
(preproc_call
|
||||
argument: (identifier)* @namespace
|
||||
) @conditional
|
||||
(#match? @conditional "ifeq")
|
||||
)
|
||||
(
|
||||
(preproc_call) @conditional
|
||||
(#match? @conditional "(else|endif)")
|
||||
)
|
||||
((preproc_call
|
||||
argument: (identifier)* @namespace) @conditional
|
||||
(#eq? @conditional "ifeq"))
|
||||
((preproc_call) @conditional
|
||||
(#any-of? @conditional "else" "endif"))
|
||||
|
||||
;; Literal numbers and strings
|
||||
(number_literal) @float
|
||||
|
|
@ -64,6 +59,7 @@
|
|||
] @punctuation.delimiter
|
||||
|
||||
;; Special identifiers
|
||||
([(identifier) "on" "off" "true" "false" "yes" "no"] @constant.builtin
|
||||
(#match? @constant.builtin "^(uniform|non-uniform|and|or|on|off|true|false|yes|no)$")
|
||||
)
|
||||
[ "on" "off" "true" "false" "yes" "no" ] @constant.builtin
|
||||
|
||||
((identifier) @constant.builtin
|
||||
(#any-of? @constant.builtin "uniform" "non-uniform" "and" "or"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue