Prefer lua-match over match

as string.find is much quicker than vim.regex:match*
This commit is contained in:
Lewis Russell 2021-11-18 09:51:03 +00:00 committed by Stephan Seitz
parent 89fbb9b39e
commit 011ac894ec
20 changed files with 67 additions and 67 deletions

View file

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