mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
v(injections): inject regex for some methods in re module
This commit is contained in:
parent
f225f53510
commit
190561df89
2 changed files with 9 additions and 0 deletions
|
|
@ -396,6 +396,8 @@
|
|||
|
||||
(rune_literal) @string
|
||||
|
||||
(raw_string_literal) @string
|
||||
|
||||
(escape_sequence) @string.escape
|
||||
|
||||
(float_literal) @float
|
||||
|
|
|
|||
|
|
@ -4,3 +4,10 @@
|
|||
;; #include <...>
|
||||
(hash_statement) @c
|
||||
|
||||
;; regex for the methods defined in `re` module
|
||||
((call_expression
|
||||
function: (selector_expression
|
||||
field: (identifier) @_re)
|
||||
arguments: (argument_list
|
||||
(raw_string_literal) @regex (#offset! @regex 0 2 0 -1)))
|
||||
(#any-of? @_re "regex_base" "regex_opt" "compile_opt"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue