mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-08 22:40:12 -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
|
|
@ -116,7 +116,7 @@
|
|||
(nil) @constant.builtin
|
||||
(spread) @constant ;; "..."
|
||||
((identifier) @constant
|
||||
(#match? @constant "^[A-Z][A-Z_0-9]*$"))
|
||||
(#lua-match? @constant "^[A-Z][A-Z_0-9]*$"))
|
||||
|
||||
;; Functions
|
||||
(function [(function_name) (identifier)] @function)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
)
|
||||
|
||||
(#eq? @_cdef_identifier "cdef")
|
||||
(#match? @c "^[\"']")
|
||||
(#lua-match? @c "^[\"']")
|
||||
(#offset! @c 0 1 0 -1)
|
||||
)
|
||||
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
)
|
||||
|
||||
(#eq? @_cdef_identifier "cdef")
|
||||
(#match? @c "^\\[\\[")
|
||||
(#lua-match? @c "^%[%[")
|
||||
(#offset! @c 0 2 0 -2)
|
||||
)
|
||||
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
)
|
||||
|
||||
(#any-of? @_vimcmd_identifier "vim.cmd" "vim.api.nvim_command" "vim.api.nvim_exec")
|
||||
(#match? @vim "^[\"']")
|
||||
(#lua-match? @vim "^[\"']")
|
||||
(#offset! @vim 0 1 0 -1)
|
||||
)
|
||||
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
)
|
||||
|
||||
(#any-of? @_vimcmd_identifier "vim.cmd" "vim.api.nvim_command" "vim.api.nvim_exec")
|
||||
(#match? @vim "^\\[\\[")
|
||||
(#lua-match? @vim "^%[%[")
|
||||
(#offset! @vim 0 2 0 -2)
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue