aboutsummaryrefslogtreecommitdiffstats
path: root/queries/python
diff options
context:
space:
mode:
Diffstat (limited to 'queries/python')
-rw-r--r--queries/python/highlights.scm8
-rw-r--r--queries/python/injections.scm5
2 files changed, 10 insertions, 3 deletions
diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm
index de98dccbf..b09122dd9 100644
--- a/queries/python/highlights.scm
+++ b/queries/python/highlights.scm
@@ -346,3 +346,11 @@
;; https://docs.python.org/3/library/stdtypes.html
"bool" "int" "float" "complex" "list" "tuple" "range" "str"
"bytes" "bytearray" "memoryview" "set" "frozenset" "dict" "type" "object"))
+
+;; Regex from the `re` module
+
+(call
+ function: (attribute
+ object: (identifier) @_re)
+ arguments: (argument_list . (string (string_content) @string.regex))
+ (#eq? @_re "re"))
diff --git a/queries/python/injections.scm b/queries/python/injections.scm
index b836ea3f7..aa36a5af9 100644
--- a/queries/python/injections.scm
+++ b/queries/python/injections.scm
@@ -1,10 +1,9 @@
(call
function: (attribute
object: (identifier) @_re)
- arguments: (argument_list (string
- (string_content) @injection.content) @_string)
+ arguments: (argument_list . (string
+ (string_content) @injection.content))
(#eq? @_re "re")
- (#lua-match? @_string "^r.*")
(#set! injection.language "regex"))
((comment) @injection.content