mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-11 07:50:07 -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
|
|
@ -10,12 +10,12 @@
|
|||
; highlight constants
|
||||
(
|
||||
(member_access_expression (identifier) @constant)
|
||||
(#match? @constant "^[A-Z][A-Z_0-9]*$")
|
||||
(#lua-match? @constant "^[%u][%u%d_]*$")
|
||||
)
|
||||
|
||||
(
|
||||
(member_access_expression (member_access_expression) @include (identifier) @constant)
|
||||
(#match? @constant "^[A-Z][A-Z_0-9]*$")
|
||||
(#lua-match? @constant "^[%u][%u%d_]*$")
|
||||
)
|
||||
|
||||
; highlight types and probable types
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
; highlight creation methods in object creation expressions
|
||||
(
|
||||
(object_creation_expression (type (symbol (symbol (symbol)? @include (identifier) @type) (identifier) @constructor)))
|
||||
(#match? @constructor "^[a-z][a-z_0-9]*$")
|
||||
(#lua-match? @constructor "^[%l][%l%d_]*$")
|
||||
)
|
||||
|
||||
(unqualified_type (symbol . (identifier) @type))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue