perf: remove match where possible

This commit is contained in:
Amaan Qureshi 2023-04-21 04:06:20 -04:00
parent 654216eb04
commit 85330918f0
37 changed files with 104 additions and 113 deletions

View file

@ -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

View file

@ -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)