mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-05 21:10:15 -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
|
|
@ -33,9 +33,9 @@
|
|||
|
||||
(namespace_identifier) @namespace
|
||||
((namespace_identifier) @type
|
||||
(#match? @type "^[A-Z]"))
|
||||
(#lua-match? @type "^[A-Z]"))
|
||||
((namespace_identifier) @constant
|
||||
(#match? @constant "^[A-Z][A-Z_0-9]*$"))
|
||||
(#lua-match? @constant "^[A-Z][A-Z_0-9]*$"))
|
||||
(namespace_definition
|
||||
name: (identifier) @namespace)
|
||||
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
((function_declarator
|
||||
declarator: (qualified_identifier
|
||||
name: (identifier) @constructor))
|
||||
(#match? @constructor "^[A-Z]"))
|
||||
(#lua-match? @constructor "^[A-Z]"))
|
||||
|
||||
(operator_name) @function
|
||||
"static_assert" @function.builtin
|
||||
|
|
@ -65,22 +65,22 @@
|
|||
|
||||
((call_expression
|
||||
function: (identifier) @constructor)
|
||||
(#match? @constructor "^[A-Z]"))
|
||||
(#lua-match? @constructor "^[A-Z]"))
|
||||
((call_expression
|
||||
function: (qualified_identifier
|
||||
name: (identifier) @constructor))
|
||||
(#match? @constructor "^[A-Z]"))
|
||||
(#lua-match? @constructor "^[A-Z]"))
|
||||
|
||||
((call_expression
|
||||
function: (field_expression
|
||||
field: (field_identifier) @constructor))
|
||||
(#match? @constructor "^[A-Z]"))
|
||||
(#lua-match? @constructor "^[A-Z]"))
|
||||
|
||||
;; constructing a type in an initializer list: Constructor (): **SuperType (1)**
|
||||
((field_initializer
|
||||
(field_identifier) @constructor
|
||||
(argument_list))
|
||||
(#match? @constructor "^[A-Z]"))
|
||||
(#lua-match? @constructor "^[A-Z]"))
|
||||
|
||||
|
||||
; Constants
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue