v(injections): inject regex for some methods in re module

This commit is contained in:
Yochem van Rosmalen 2023-03-03 18:55:49 +01:00 committed by Amaan Qureshi
parent f225f53510
commit 190561df89
2 changed files with 9 additions and 0 deletions

View file

@ -396,6 +396,8 @@
(rune_literal) @string
(raw_string_literal) @string
(escape_sequence) @string.escape
(float_literal) @float

View file

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