| 1 | ((comment) @injection.content |
| 2 | (#set! injection.language "comment")) |
| 3 | |
| 4 | ; Match all 9 functions in the `re` module from the standard library that |
| 5 | ; that takes a regex pattern as first argument. |
| 6 | ; https://docs.python.org/3/library/re.html#functions |
| 7 | (call |
| 8 | function: (attribute |
| 9 | object: (identifier) @_module (#eq? @_module "re") |
| 10 | attribute: (identifier) @_function (#any-of? @_function "compile" "search" "match" "fullmatch" "sub" "subn" "findall" "finditer" "split")) |
| 11 | arguments: (argument_list |
| 12 | . (string |
| 13 | (string_content) @injection.content)) |
| 14 | (#set! injection.language "regex")) |