mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat(rust): add more regex injection queries
This commit is contained in:
parent
ede5b461c9
commit
6f1f407d71
1 changed files with 30 additions and 2 deletions
|
|
@ -48,7 +48,7 @@
|
|||
function:
|
||||
(scoped_identifier
|
||||
path: (identifier) @_regex
|
||||
(#eq? @_regex "Regex")
|
||||
(#any-of? @_regex "Regex" "ByteRegexBuilder")
|
||||
name: (identifier) @_new
|
||||
(#eq? @_new "new"))
|
||||
arguments:
|
||||
|
|
@ -62,7 +62,7 @@
|
|||
path:
|
||||
(scoped_identifier
|
||||
(identifier) @_regex
|
||||
(#eq? @_regex "Regex") .)
|
||||
(#any-of? @_regex "Regex" "ByteRegexBuilder") .)
|
||||
name: (identifier) @_new
|
||||
(#eq? @_new "new"))
|
||||
arguments:
|
||||
|
|
@ -70,6 +70,34 @@
|
|||
(raw_string_literal) @injection.content)
|
||||
(#set! injection.language "regex"))
|
||||
|
||||
(call_expression
|
||||
function:
|
||||
(scoped_identifier
|
||||
path: (identifier) @_regex
|
||||
(#any-of? @_regex "RegexSet" "RegexSetBuilder")
|
||||
name: (identifier) @_new
|
||||
(#eq? @_new "new"))
|
||||
arguments:
|
||||
(arguments
|
||||
(array_expression
|
||||
(raw_string_literal) @injection.content))
|
||||
(#set! injection.language "regex"))
|
||||
|
||||
(call_expression
|
||||
function:
|
||||
(scoped_identifier
|
||||
path:
|
||||
(scoped_identifier
|
||||
(identifier) @_regex
|
||||
(#any-of? @_regex "RegexSet" "RegexSetBuilder") .)
|
||||
name: (identifier) @_new
|
||||
(#eq? @_new "new"))
|
||||
arguments:
|
||||
(arguments
|
||||
(array_expression
|
||||
(raw_string_literal) @injection.content))
|
||||
(#set! injection.language "regex"))
|
||||
|
||||
((block_comment) @injection.content
|
||||
(#match? @injection.content "/\\*!([a-zA-Z]+:)?re2c")
|
||||
(#set! injection.language "re2c"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue