mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
fix(python): regex injection not working for concatenated strings (#8197)
Co-authored-by: Riley Bruins <ribru17@hotmail.com>
This commit is contained in:
parent
98fe644cb3
commit
c53bb10a71
7 changed files with 83 additions and 3 deletions
|
|
@ -417,11 +417,19 @@
|
|||
function: (attribute
|
||||
object: (identifier) @_re)
|
||||
arguments: (argument_list
|
||||
.
|
||||
(string
|
||||
(string_content) @string.regexp))
|
||||
(#eq? @_re "re"))
|
||||
|
||||
(call
|
||||
function: (attribute
|
||||
object: (identifier) @_re)
|
||||
arguments: (argument_list
|
||||
(concatenated_string
|
||||
(string
|
||||
(string_content) @string.regexp)))
|
||||
(#eq? @_re "re"))
|
||||
|
||||
; Decorators
|
||||
((decorator
|
||||
"@" @attribute)
|
||||
|
|
|
|||
|
|
@ -2,12 +2,24 @@
|
|||
function: (attribute
|
||||
object: (identifier) @_re)
|
||||
arguments: (argument_list
|
||||
.
|
||||
(string
|
||||
(string_content) @injection.content))
|
||||
(#eq? @_re "re")
|
||||
(#set! injection.language "regex"))
|
||||
|
||||
(call
|
||||
function: (attribute
|
||||
object: (identifier) @_re)
|
||||
arguments: (argument_list
|
||||
(concatenated_string
|
||||
[
|
||||
(string
|
||||
(string_content) @injection.content)
|
||||
(comment)
|
||||
]+))
|
||||
(#eq? @_re "re")
|
||||
(#set! injection.language "regex"))
|
||||
|
||||
((binary_operator
|
||||
left: (string
|
||||
(string_content) @injection.content)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue