aboutsummaryrefslogtreecommitdiffstats
path: root/tests/query/highlights/python
diff options
context:
space:
mode:
authorLev Velykoivanenko <velykoivanenko.lev@gmail.com>2025-10-26 17:25:42 +0100
committerGitHub <noreply@github.com>2025-10-26 09:25:42 -0700
commitc53bb10a71a04860758757b190620814b4993a77 (patch)
tree8390c77671b682894d42f5fe374f5f92552d0f80 /tests/query/highlights/python
parentfeat(parsers): update c3, desktop, dot, gomod, idl, julia, kitty, matlab, mli... (diff)
downloadnvim-treesitter-c53bb10a71a04860758757b190620814b4993a77.tar
nvim-treesitter-c53bb10a71a04860758757b190620814b4993a77.tar.gz
nvim-treesitter-c53bb10a71a04860758757b190620814b4993a77.tar.bz2
nvim-treesitter-c53bb10a71a04860758757b190620814b4993a77.tar.lz
nvim-treesitter-c53bb10a71a04860758757b190620814b4993a77.tar.xz
nvim-treesitter-c53bb10a71a04860758757b190620814b4993a77.tar.zst
nvim-treesitter-c53bb10a71a04860758757b190620814b4993a77.zip
fix(python): regex injection not working for concatenated strings (#8197)
Co-authored-by: Riley Bruins <ribru17@hotmail.com>
Diffstat (limited to 'tests/query/highlights/python')
-rw-r--r--tests/query/highlights/python/regex.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/query/highlights/python/regex.py b/tests/query/highlights/python/regex.py
new file mode 100644
index 000000000..385ec7760
--- /dev/null
+++ b/tests/query/highlights/python/regex.py
@@ -0,0 +1,19 @@
+import re
+
+re_test = re.compile(r"^(?P<year>\d{4}) (?P<day>\d) \w\s{,3}$")
+# ^ @string.regexp
+re_test = re.compile(
+ # comment
+ # ^ @comment
+ r"^(?P<year>\d{4}){1}"
+ # ^ @string.regexp
+ # comment
+ # ^ @comment
+ r"(?P<day>\d) \w\s{,3}"
+ # ^ @string.regexp
+ # comment
+ # ^ @comment
+)
+# interpolation
+print("foo %s bar %d" % ("arg1", 2))
+# ^ @character