mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-09 06:50:06 -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
|
|
@ -64,7 +64,7 @@
|
|||
|
||||
(num_lit) @number
|
||||
|
||||
((sym_lit) @boolean (#match? @boolean "^(t|T)$"))
|
||||
((sym_lit) @boolean (#any-of? @boolean "t" "T"))
|
||||
|
||||
(nil_lit) @constant.builtin
|
||||
|
||||
|
|
@ -72,7 +72,7 @@
|
|||
|
||||
;; dynamic variables
|
||||
((sym_lit) @variable.builtin
|
||||
(#match? @variable.builtin "^[*].+[*]$"))
|
||||
(#lua-match? @variable.builtin "^[*].+[*]$"))
|
||||
|
||||
;; quote
|
||||
"'" @string.escape
|
||||
|
|
@ -147,7 +147,7 @@
|
|||
|
||||
;; constant
|
||||
((sym_lit) @constant
|
||||
(#match? @constant "^[+].+[+]$"))
|
||||
(#lua-match? @constant "^[+].+[+]$"))
|
||||
|
||||
(var_quoting_lit
|
||||
marker: "#'" @symbol
|
||||
|
|
@ -180,7 +180,7 @@
|
|||
|
||||
|
||||
((sym_lit) @symbol
|
||||
(#match? @symbol "^[&]"))
|
||||
(#lua-match? @symbol "^[&]"))
|
||||
|
||||
[(array_dimension) "#0A" "#0a"] @number
|
||||
|
||||
|
|
|
|||
|
|
@ -22,14 +22,14 @@
|
|||
(sym_lit) @_deftest
|
||||
.
|
||||
(sym_lit) @definition.function
|
||||
(#match? @_deftest "^(deftest)$")) @scope
|
||||
(#eq? @_deftest "deftest")) @scope
|
||||
|
||||
(list_lit
|
||||
.
|
||||
(sym_lit) @_deftest
|
||||
.
|
||||
(sym_lit) @definition.function
|
||||
(#match? @_deftest "^(deftest)$")) @scope
|
||||
(#eq? @_deftest "deftest")) @scope
|
||||
|
||||
(for_clause . (sym_lit) @definition.var)
|
||||
(with_clause . (sym_lit) @definition.var)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue