]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(python): Fix indenting for brackets within python byte strings
authorqwavies <qwavsbusiness@gmail.com>
Sun, 26 Jul 2026 14:28:29 +0000 (14:28 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 26 Jul 2026 14:28:29 +0000 (14:28 +0000)
Problem:  s:SearchBracket()'s skip-expression matches syntax group
          names ending in "Comment", "Todo", or "String" to decide
          whether a candidate bracket is inside a string/comment
          and should be skipped for indentation purposes. Byte and
          raw-byte string literals (b"...", rb"...") are highlighted
          via the pythonBytes/pythonRawBytes syntax groups, which
          don't end in "String", so brackets inside them (e.g.
          b"[") were never skipped and were counted as real,
          unmatched brackets, producing incorrect indentation.

Solution: Add "Bytes" to the indent script's existing suffix match,
          so pythonBytes/pythonRawBytes are recognized directly, the
          same way pythonString/pythonFString/pythonRawString
          already are.

          This supersedes an earlier version of this fix that
          renamed pythonBytes/pythonRawBytes to
          pythonBytesString/pythonRawBytesString in
          runtime/syntax/python.vim.

fixes:  #20812
closes: #20827

Signed-off-by: qwavies <qwavsbusiness@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
19 files changed:
runtime/autoload/python.vim
runtime/indent/testdir/python.in
runtime/indent/testdir/python.ok
runtime/syntax/testdir/dumps/python_strings_bytes_02.dump
runtime/syntax/testdir/dumps/python_strings_bytes_03.dump
runtime/syntax/testdir/dumps/python_strings_bytes_04.dump
runtime/syntax/testdir/dumps/python_strings_bytes_05.dump
runtime/syntax/testdir/dumps/python_strings_bytes_06.dump
runtime/syntax/testdir/dumps/python_strings_bytes_07.dump
runtime/syntax/testdir/dumps/python_strings_bytes_08.dump
runtime/syntax/testdir/dumps/python_strings_bytes_09.dump
runtime/syntax/testdir/dumps/python_strings_bytes_10.dump
runtime/syntax/testdir/dumps/python_strings_bytes_11.dump
runtime/syntax/testdir/dumps/python_strings_bytes_12.dump
runtime/syntax/testdir/dumps/python_strings_bytes_13.dump
runtime/syntax/testdir/dumps/python_strings_bytes_14.dump
runtime/syntax/testdir/dumps/python_strings_bytes_15.dump
runtime/syntax/testdir/dumps/python_strings_bytes_16.dump [new file with mode: 0644]
runtime/syntax/testdir/input/python_strings_bytes.py

index cf01198d73c82853b0707d7aeab9a14efe370b92..8723b4ebea42853e8e0d5c235aa054d999ac8946 100644 (file)
@@ -23,7 +23,7 @@ function s:SearchBracket(fromlnum, flags)
   " VIM_INDENT_TEST_TRACE_START
   return searchpairpos('[[({]', '', '[])}]', a:flags,
           \ {-> synstack('.', col('.'))
-          \ ->indexof({_, id -> synIDattr(id, 'name') =~ '\%(Comment\|Todo\|String\)$'}) >= 0},
+          \ ->indexof({_, id -> synIDattr(id, 'name') =~ '\%(Comment\|Todo\|String\|Bytes\)$'}) >= 0},
           \ [0, a:fromlnum - s:maxoff]->max(), g:python_indent.searchpair_timeout)
   " VIM_INDENT_TEST_TRACE_END python#s:SearchBracket
 endfunction
index 1f7654ae933240aa0f53ed0379eb90929b5450dc..2a2f5bab55dbc72241ce8ca5bd83d6e306b4ee2c 100644 (file)
@@ -94,3 +94,29 @@ open_paren_at_EOL(
 100, 200, 300, 400)
 
 # END_INDENT
+
+# START_INDENT
+"["
+#
+b"abc"
+#
+f"["
+#
+r"["
+#
+b"["
+#
+b"["
+b"]"
+#
+b"("
+#
+b"{"
+#
+b"(" b")"
+#
+b"{" b"}"
+#
+# END_INDENT
+
+
index aaeb69cdf3bb99bcb8602bc499833a11b1cf477e..6e25b5e149988089f118f86dc184fc991101a7ff 100644 (file)
@@ -94,3 +94,29 @@ open_paren_at_EOL(
         100, 200, 300, 400)
 
 # END_INDENT
+
+# START_INDENT
+"["
+#
+b"abc"
+#
+f"["
+#
+r"["
+#
+b"["
+#
+b"["
+b"]"
+#
+b"("
+#
+b"{"
+#
+b"(" b")"
+#
+b"{" b"}"
+#
+# END_INDENT
+
+
index 86d9560e4398f7a7d2421e2e736bec007ad2145b..89894abc4e0f4481ac46e83b4ad4808a53b54e42 100644 (file)
@@ -17,4 +17,4 @@
 |#+0#0000e05&| |R|a|w| |U|n|i|c|o|d|e| |l|i|t|e|r|a|l|s| |a|r|e| |n|o|t| |a|l@1|o|w|e|d| +0#0000000&@36
 |t|e|s|t| |=| |u|r+0#e000002&|'|I|n|v|a|l|i|d| |s|t|r|i|n|g| |w|i|t|h| |\|'| |a|n|d| |\|"| |a|n|d| |\|t|'| +0#0000000&@27
 |t|e|s|t| |=| |u|R+0#e000002&|"|I|n|v|a|l|i|d| |s|t|r|i|n|g| |w|i|t|h| |\|0|4|0| |a|n|d| |\|x|F@1|"| +0#0000000&@30
-@57|3@1|,|1| @9|1|2|%| 
+@57|3@1|,|1| @9|1@1|%| 
index b8ee777d39f5ebcb38d2eeac94478910ab077d42..32724706104bbd405a24c76a512f2f743e7abf77 100644 (file)
@@ -17,4 +17,4 @@
 |a+0#e000002&|n|d| |\+0#e000e06&|u|0@1|A|1| +0#e000002&|a|n|d| |\+0#e000e06&|U|0@2|1|0|6|0|5|"+0#e000002&@2| +0#0000000&@46
 @75
 |#+0#0000e05&| |F|o|r|m|a|t@1|e|d| |s|t|r|i|n|g| |l|i|t|e|r|a|l|s| |(|f|-|s|t|r|i|n|g|s|)| +0#0000000&@35
-@57|4|9|,|1| @9|1|8|%| 
+@57|4|9|,|1| @9|1|7|%| 
index bb963d084680bbec8a499e0e70f9eff9795a4e9c..af475b6c1e1905296498b7e8e21d33972c6b59f0 100644 (file)
@@ -17,4 +17,4 @@
 |a+0#e000002&|n|d| |f|i|e|l|d|s| |{+0#e000e06&|1+0#e000002&|}+0#e000e06&|,+0#e000002&| |{+0#e000e06&|2+0#e000002&|}+0#e000e06&| +0#e000002&|a|n|d| |{+0#e000e06&|1+0#e000002&| +0#0000000&@48
 @4|+| @69
 @4|2+0#e000002&|}+0#e000e06&|"+0#e000002&@2| +0#0000000&@65
-@57|6@1|,|1| @9|2|5|%| 
+@57|6@1|,|1| @9|2|4|%| 
index 23afd16a4446166f95abd06833477f379f181bf4..3108e1c8f6b2c2651c29d2252641941ffe16557d 100644 (file)
@@ -17,4 +17,4 @@
 |t|e|s|t| |=| |R+0#e000002&|F|"|R|a|w| |f|-|s|t|r|i|n|g| |w|i|t|h| |l|i|t|e|r|a|l| |{@1|f|i|e|l|d|}@1| |a|n|d| |f|i|e|l|d|s| |{+0#e000e06&|f+0#0000000&|o@1|}+0#e000e06&| +0#e000002&|a|n|d| |{+0#e000e06&|b+0#0000000&|a|r|}+0#e000e06&|"+0#e000002&| +0#0000000&@1
 |t|e|s|t| |=| |f+0#e000002&|r|'@2|R|a|w| |f|-|s|t|r|i|n|g| |w|i|t|h| |q|u|o|t|e|s| |'| |a|n|d| |"| +0#0000000&@30
 |a+0#e000002&|n|d| |l|i|t|e|r|a|l| |\|t| |a|n|d| |\|0|4|0| |a|n|d| |\|x|F@1| +0#0000000&@42
-@57|8|2|,|1| @9|3|2|%| 
+@57|8|2|,|1| @9|3|0|%| 
index eb1ae0c310b4d0ee50ddae59ca9c3747bbc42962..8f1352e8125f3709d70d6a02fb53f82c1f81eaad 100644 (file)
@@ -17,4 +17,4 @@
 |t+0#0000000&|e|s|t| |=| |T+0#e000002&|"|T|-|s|t|r|i|n|g| |w|i|t|h| |e|s|c|a|p|e|s| |\+0#e000e06&|0|4|0| +0#e000002&|a|n|d| |\+0#e000e06&|x|F@1| +0#e000002&|a|n|d| |f|i|e|l|d|s| |{+0#e000e06&|f+0#0000000&|o@1|}+0#e000e06&| +0#e000002&|a|n|d| |{+0#e000e06&|b+0#0000000&|a|r|}+0#e000e06&|"+0#e000002&| +0#0000000&@2
 |t|e|s|t| |=| |t+0#e000002&|'|T|-|s|t|r|i|n|g| |w|i|t|h| |e|s|c|a|p|e|s| |\+0#e000e06&|u|0@1|A|1| +0#e000002&|a|n|d| |\+0#e000e06&|U|0@2|1|0|6|0|5| +0#e000002&|a|n|d| |\+0#e000e06&|N|{|I|N|V|E|R|T|E|D| |E|X|C|L|A|M
 |A|T|I|O|N| |M|A|R|K|}| +0#e000002&|a|n|d| |f|i|e|l|d|s| |{+0#e000e06&|f+0#0000000&|o@1|}+0#e000e06&| +0#e000002&|a|n|d| |{+0#e000e06&|b+0#0000000&|a|r|}+0#e000e06&|'+0#e000002&| +0#0000000&@35
-@57|9|5|,|1| @9|3|8|%| 
+@57|9|5|,|1| @9|3|6|%| 
index ac44922a385ded805791b3a4d1cd77dc8965cba9..d8d600cbb9c1889edb785753701bf52ff8a572fe 100644 (file)
@@ -17,4 +17,4 @@
 |#+0#0000e05&| |R|a|w| |t|e|m|p|l|a|t|e| |s|t|r|i|n|g| |l|i|t|e|r|a|l|s| +0#0000000&@44
 |t|e|s|t| |=| |t+0#e000002&|r|'|R|a|w| |t|-|s|t|r|i|n|g| |w|i|t|h| |l|i|t|e|r|a|l| |\|'| |a|n|d| |\|"| |a|n|d| |\|t| |a|n|d| |f|i|e|l|d|s| |{+0#e000e06&|f+0#0000000&|o@1|}+0#e000e06&| +0#e000002&|a|n|d| |{+0#e000e06&
 |b+0#0000000&|a|r|}+0#e000e06&|'+0#e000002&| +0#0000000&@69
-@57|1@1|0|,|1| @8|4|5|%| 
+@57|1@1|0|,|1| @8|4|2|%| 
index 34090dc857f214b637cde754378f30be582425da..86e14f46f41e723d5d4f0801f8536984241db063 100644 (file)
@@ -17,4 +17,4 @@
 |a+0#e000002&|n|d| |l|i|t|e|r|a|l| |\|u|0@1|A|1| |a|n|d| |\|U|0@2|1|0|6|0|5| +0#0000000&@41
 |a+0#e000002&|n|d| |f|i|e|l|d|s| |{+0#e000e06&|1+0#e000002&|}+0#e000e06&|,+0#e000002&| |{+0#e000e06&|2+0#e000002&|}+0#e000e06&| +0#e000002&|a|n|d| |{+0#e000e06&|1+0#e000002&| +0#0000000&@48
 @4|+| @69
-@57|1|2|5|,|1| @8|5|1|%| 
+@57|1|2|5|,|1| @8|4|8|%| 
index 56be10e7cca2efb2e221506945c3b636fbe5b24d..2ab49cc46c00114dd955e3ab6dcb3a42324028f4 100644 (file)
@@ -17,4 +17,4 @@
 @4|2+0#e000002&| +0#0000000&|+| @67
 @4|3+0#e000002&|}+0#e000e06&|"+0#e000002&| +0#0000000&@67
 |t|e|s|t| |=| |f+0#e000002&|"|F|l|o|a|t| |i|s| |{+0#e000e06&|1+0#e000002&|.|2|3|}+0#e000e06&|"+0#e000002&| +0#0000000&@49
-@57|1|3|9|,|1| @8|5|7|%| 
+@57|1|3|9|,|1| @8|5|4|%| 
index 882875c9ef9c8d046a081405be3254d6c91dadc8..fb8502c5e217367a54780d82cb1bc225e8d0d462 100644 (file)
@@ -17,4 +17,4 @@
 |t|e|s|t| |=| |f+0#e000002&|"|r|e|s|u|l|t|:| |{+0#e000e06&|v+0#0000000&|a|l|u|e|:+0#e000e06&|{|w|i|d|t|h|:|d|}|.|{|p|r|e|c|i|s|i|o|n|!|s|}@1|"+0#e000002&| +0#0000000&@25
 |t|e|s|t| |=| |f+0#e000002&|"|r|e|s|u|l|t|:| |{+0#e000e06&|v+0#0000000&|a|l|u|e|:+0#e000e06&|{|o|p|t|i|o|n|s|}|{|w|i|d|t|h|}|{|g|r|o|u|p|i|n|g|}|{|p|r|e|c|i|s|i|o|n|}|{|t|y|p|e|}@1|"+0#e000002&| +0#0000000&@5
 |t|e|s|t| |=| |f+0#e000002&|"|{+0#e000e06&|n+0#0000000&|u|m|b|e|r|:+0#e000e06&|#|0|x|}|"+0#e000002&| +0#0000000&@52
-@57|1|5|7|,|1| @8|6|5|%| 
+@57|1|5|7|,|1| @8|6|1|%| 
index 03ca4e2dd6553c83898b2021f198fc1a4405561a..87592e171827a688e27fad83b08f50d53b46f281 100644 (file)
@@ -17,4 +17,4 @@
 |t|e|s|t| |=| |f+0#e000002&|"|a|b|c| |{+0#e000e06&|a+0#0000000&|[|"+0#e000002&|x|"|]+0#0000000&|}+0#e000e06&| +0#e000002&|d|e|f|"| +0#0000000&@48
 |t|e|s|t| |=| |f+0#e000002&|"|L|i|s|t| |c|o|n|t|a|i|n|s|:|\+0#e000e06&|n|{|"+0#e000002&|\+0#e000e06&|n|"+0#e000002&|.+0#0000000&|j|o|i|n|(|a|)|}+0#e000e06&|"+0#e000002&| +0#0000000&@34
 |t|e|s|t| |=| |f+0#e000002&|"|T|o|d|a|y|'|s| |d|a|t|e| |i|s| |{+0#e000e06&|d+0#0000000&|a|t|e|t|i|m|e|.|n|o|w|(|)|}+0#e000e06&|"+0#e000002&| +0#0000000&@32
-@57|1|7|5|,|1| @8|7|3|%| 
+@57|1|7|5|,|1| @8|6|8|%| 
index 55c8de886e2d201a544fcae036c1729d26b9c20e..c656774ec9a51ded4bb1de476eca53f4242a9005 100644 (file)
@@ -17,4 +17,4 @@
 |t|e|s|t| |=| |f+0#e000002&|"|E|x|p|r|e|s@1|i|o|n| |i|s| |{+0#e000e06&|x+0#0000000&| |=@1| |1+0#e000002&|}+0#e000e06&|"+0#e000002&| +0#0000000&@42
 |t|e|s|t| |=| |f+0#e000002&|"|E|x|p|r|e|s@1|i|o|n| |i|s| |{+0#e000e06&|x+0#0000000&| |!|=| |1+0#e000002&|}+0#e000e06&|"+0#e000002&| +0#0000000&@42
 |t|e|s|t| |=| |f+0#e000002&|"|E|x|p|r|e|s@1|i|o|n| |i|s| |{+0#e000e06&|(+0#0000000&|x| |:|=| |1+0#e000002&|)+0#0000000&|}+0#e000e06&|"+0#e000002&| +0#0000000&@40
-@57|1|9|2|,|1| @8|8|0|%| 
+@57|1|9|2|,|1| @8|7|6|%| 
index 1924c9f006c21efc1ce354e9d6305227fbbf29ab..748c058303e31568bd63c8f925c2040ed81de463 100644 (file)
@@ -17,4 +17,4 @@
 @75
 |#+0#0000e05&| |B|y|t|e|s| +0#0000000&@67
 |t|e|s|t| |=| |b+0#e000002&|'|B|y|t|e|s| |w|i|t|h| |e|s|c|a|p|e|s| |\+0#e000e06&|'| +0#e000002&|a|n|d| |\+0#e000e06&|"| +0#e000002&|a|n|d| |\+0#e000e06&|t|'+0#e000002&| +0#0000000&@29
-@57|2|1|0|,|1| @8|8|7|%| 
+@57|2|1|0|,|1| @8|8|2|%| 
index 882a1e90114390129e174733fee36355d08b95b9..0652de04893b3a6d6ba2fd1b0ee14613a87a9fed 100644 (file)
 |t|e|s|t| |=| |B+0#e000002&|"@2|B|y|t|e|s| |w|i|t|h| |q|u|o|t|e|s| |'| |a|n|d| |"| +0#0000000&@38
 |a+0#e000002&|n|d| |e|s|c|a|p|e|s| |\+0#e000e06&|t| +0#e000002&|a|n|d| |\+0#e000e06&|0|4|0| +0#e000002&|a|n|d| |\+0#e000e06&|x|F@1| +0#0000000&@42
 |a+0#e000002&|n|d| |S|y|n|t|a|x|W|a|r|n|i|n|g| |\|u|0@1|A|1| |a|n|d| |\|U|0@2|1|0|6|0|5|"@2| +0#0000000&@32
+|t|e|s|t| |=| |b+0#e000002&|"|B|y|t|e|s| |w|i|t|h| |b|r|a|c|k|e|t| |[|"| +0#0000000&@44
+|t|e|s|t| |=| |b+0#e000002&|"|B|y|t|e|s| |w|i|t|h| |b|r|a|c|k|e|t| |(|"| +0#0000000&@44
+|t|e|s|t| |=| |b+0#e000002&|"|B|y|t|e|s| |w|i|t|h| |b|r|a|c|k|e|t| |{|"| +0#0000000&@44
 @75
 |#+0#0000e05&| |R|a|w| |b|y|t|e|s| +0#0000000&@63
 |t|e|s|t| |=| |b+0#e000002&|r|'|R|a|w| |b|y|t|e|s| |w|i|t|h| |l|i|t|e|r|a|l| |\|'| |a|n|d| |\|"| |a|n|d| |\|t|'| +0#0000000&@24
 |t|e|s|t| |=| |b+0#e000002&|R|"|R|a|w| |b|y|t|e|s| |w|i|t|h| |l|i|t|e|r|a|l| |\|0|4|0| |a|n|d| |\|x|F@1|"| +0#0000000&@27
-|t|e|s|t| |=| |B+0#e000002&|r|'|R|a|w| |b|y|t|e|s| |w|i|t|h| |l|i|t|e|r|a|l| |\|u|0@1|A|1| |a|n|d| |\|U|0@2|1|0|6|0|5| |a|n|d| |\|N|{|I|N|V|E|R|T|E|D| |E|X|C|L
-|A|M|A|T|I|O|N| |M|A|R|K|}|'| +0#0000000&@60
-|t|e|s|t| |=| |B+0#e000002&|R|"|R|a|w| |b|y|t|e|s| |w|i|t|h| |l|i|t|e|r|a|l| |\@1| |b|a|c|k|s|l|a|s|h|e|s| |a|n|d| |l|i|t|e|r|a|l| |\| +0#0000000&@13
-@57|2@1|5|,|1| @8|9|4|%| 
+@57|2@1|5|,|1| @8|8|9|%| 
index 52fce247fe4a70f52e2ff64abc0f041ff031243a..92d457e2197d717eadaece793dae025a4000d7e3 100644 (file)
@@ -1,10 +1,13 @@
-|t+0&#ffffff0|e|s|t| |=| |B+0#e000002&|R|"|R|a|w| |b|y|t|e|s| |w|i|t|h| |l|i|t|e|r|a|l| |\@1| |b|a|c|k|s|l|a|s|h|e|s| |a|n|d| |l|i|t|e|r|a|l| |\| +0#0000000&@13
+|t+0&#ffffff0|e|s|t| |=| |b+0#e000002&|R|"|R|a|w| |b|y|t|e|s| |w|i|t|h| |l|i|t|e|r|a|l| |\|0|4|0| |a|n|d| |\|x|F@1|"| +0#0000000&@27
+|t|e|s|t| |=| |B+0#e000002&|r|'|R|a|w| |b|y|t|e|s| |w|i|t|h| |l|i|t|e|r|a|l| |\|u|0@1|A|1| |a|n|d| |\|U|0@2|1|0|6|0|5| |a|n|d| |\|N|{|I|N|V|E|R|T|E|D| |E|X|C|L
+|A|M|A|T|I|O|N| |M|A|R|K|}|'| +0#0000000&@60
+|t|e|s|t| |=| |B+0#e000002&|R|"|R|a|w| |b|y|t|e|s| |w|i|t|h| |l|i|t|e|r|a|l| |\@1| |b|a|c|k|s|l|a|s|h|e|s| |a|n|d| |l|i|t|e|r|a|l| |\| +0#0000000&@13
 |n+0#e000002&|e|w|l|i|n|e|"| +0#0000000&@66
-|t|e|s|t| |=| |r+0#e000002&|b|'|R|a|w| |b|y|t|e|s| |w|i|t|h| |l|i|t|e|r|a|l| |\|'| |a|n|d| |\|"| |a|n|d| |\|t|'| +0#0000000&@24
+>t|e|s|t| |=| |r+0#e000002&|b|'|R|a|w| |b|y|t|e|s| |w|i|t|h| |l|i|t|e|r|a|l| |\|'| |a|n|d| |\|"| |a|n|d| |\|t|'| +0#0000000&@24
 |t|e|s|t| |=| |r+0#e000002&|B|"|R|a|w| |b|y|t|e|s| |w|i|t|h| |l|i|t|e|r|a|l| |\|0|4|0| |a|n|d| |\|x|F@1|"| +0#0000000&@27
 |t|e|s|t| |=| |R+0#e000002&|b|'|R|a|w| |b|y|t|e|s| |w|i|t|h| |l|i|t|e|r|a|l| |\|u|0@1|A|1| |a|n|d| |\|U|0@2|1|0|6|0|5| |a|n|d| |\|N|{|I|N|V|E|R|T|E|D| |E|X|C|L
 |A|M|A|T|I|O|N| |M|A|R|K|}|'| +0#0000000&@60
->t|e|s|t| |=| |R+0#e000002&|B|"|R|a|w| |b|y|t|e|s| |w|i|t|h| |l|i|t|e|r|a|l| |\@1| |b|a|c|k|s|l|a|s|h|e|s| |a|n|d| |l|i|t|e|r|a|l| |\| +0#0000000&@13
+|t|e|s|t| |=| |R+0#e000002&|B|"|R|a|w| |b|y|t|e|s| |w|i|t|h| |l|i|t|e|r|a|l| |\@1| |b|a|c|k|s|l|a|s|h|e|s| |a|n|d| |l|i|t|e|r|a|l| |\| +0#0000000&@13
 |n+0#e000002&|e|w|l|i|n|e|"| +0#0000000&@66
 |t|e|s|t| |=| |b+0#e000002&|r|'@2|R|a|w| |b|y|t|e|s| |w|i|t|h| |q|u|o|t|e|s| |'| |a|n|d| |"| +0#0000000&@33
 |a+0#e000002&|n|d| |l|i|t|e|r|a|l| |\|t| |a|n|d| |\|0|4|0| |a|n|d| |\|x|F@1| +0#0000000&@42
@@ -12,9 +15,6 @@
 |t|e|s|t| |=| |R+0#e000002&|B|"@2|R|a|w| |b|y|t|e|s| |w|i|t|h| |q|u|o|t|e|s| |'| |a|n|d| |"| +0#0000000&@33
 |a+0#e000002&|n|d| |l|i|t|e|r|a|l| |\|t| |a|n|d| |\|0|4|0| |a|n|d| |\|x|F@1| +0#0000000&@42
 |a+0#e000002&|n|d| |l|i|t|e|r|a|l| |\|u|0@1|A|1| |a|n|d| |\|U|0@2|1|0|6|0|5|"@2| +0#0000000&@38
-|~+0#4040ff13&| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-| +0#0000000&@56|2|4|2|,|1| @8|B|o|t| 
+|t|e|s|t| |=| |r+0#e000002&|b|"|R|a|w| |b|y|t|e|s| |w|i|t|h| |b|r|a|c|k|e|t| |[|"| +0#0000000&@39
+|t|e|s|t| |=| |r+0#e000002&|b|"|R|a|w| |b|y|t|e|s| |w|i|t|h| |b|r|a|c|k|e|t| |(|"| +0#0000000&@39
+@57|2|4|2|,|1| @8|9|5|%| 
diff --git a/runtime/syntax/testdir/dumps/python_strings_bytes_16.dump b/runtime/syntax/testdir/dumps/python_strings_bytes_16.dump
new file mode 100644 (file)
index 0000000..3b8500f
--- /dev/null
@@ -0,0 +1,20 @@
+|t+0&#ffffff0|e|s|t| |=| |r+0#e000002&|b|"|R|a|w| |b|y|t|e|s| |w|i|t|h| |b|r|a|c|k|e|t| |(|"| +0#0000000&@39
+|t|e|s|t| |=| |r+0#e000002&|b|"|R|a|w| |b|y|t|e|s| |w|i|t|h| |b|r|a|c|k|e|t| |{|"| +0#0000000&@39
+|t|e|s|t| |=| |R+0#e000002&|b|"|R|a|w| |b|y|t|e|s| |w|i|t|h| |b|r|a|c|k|e|t| |[|"| +0#0000000&@39
+|t|e|s|t| |=| |R+0#e000002&|b|"|R|a|w| |b|y|t|e|s| |w|i|t|h| |b|r|a|c|k|e|t| |(|"| +0#0000000&@39
+|t|e|s|t| |=| |R+0#e000002&|b|"|R|a|w| |b|y|t|e|s| |w|i|t|h| |b|r|a|c|k|e|t| |{|"| +0#0000000&@39
+>t|e|s|t| |=| |b+0#e000002&|R|"|R|a|w| |b|y|t|e|s| |w|i|t|h| |b|r|a|c|k|e|t| |[|"| +0#0000000&@39
+|t|e|s|t| |=| |b+0#e000002&|R|"|R|a|w| |b|y|t|e|s| |w|i|t|h| |b|r|a|c|k|e|t| |(|"| +0#0000000&@39
+|t|e|s|t| |=| |b+0#e000002&|R|"|R|a|w| |b|y|t|e|s| |w|i|t|h| |b|r|a|c|k|e|t| |{|"| +0#0000000&@39
+@75
+@75
+@75
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|2|5|9|,|1| @8|B|o|t| 
index 569168637e7e724a3c8fb88c5b3d51b9ccbe31cc..f8b880ef091b98b113ad201b975c95fb52644596 100644 (file)
@@ -229,6 +229,9 @@ and SyntaxWarning \u00A1 and \U00010605'''
 test = B"""Bytes with quotes ' and "
 and escapes \t and \040 and \xFF
 and SyntaxWarning \u00A1 and \U00010605"""
+test = b"Bytes with bracket ["
+test = b"Bytes with bracket ("
+test = b"Bytes with bracket {"
 
 # Raw bytes
 test = br'Raw bytes with literal \' and \" and \t'
@@ -247,3 +250,15 @@ and literal \u00A1 and \U00010605'''
 test = RB"""Raw bytes with quotes ' and "
 and literal \t and \040 and \xFF
 and literal \u00A1 and \U00010605"""
+test = rb"Raw bytes with bracket ["
+test = rb"Raw bytes with bracket ("
+test = rb"Raw bytes with bracket {"
+test = Rb"Raw bytes with bracket ["
+test = Rb"Raw bytes with bracket ("
+test = Rb"Raw bytes with bracket {"
+test = bR"Raw bytes with bracket ["
+test = bR"Raw bytes with bracket ("
+test = bR"Raw bytes with bracket {"
+
+
+