]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(python): Highlight f-string replacement fields in Python master
authorRob B <github@0x7e.net>
Sun, 10 Aug 2025 08:35:31 +0000 (10:35 +0200)
committerChristian Brabandt <cb@256bit.org>
Sun, 10 Aug 2025 08:35:31 +0000 (10:35 +0200)
Highlight f-string replacement fields, including

- Comments
- Debugging flags
- Conversion fields
- Format specifications
- Delimiters

Syntax inside fields will be addressed in a separate commit.

related: #10734
related: #14033
closes: #17784

Signed-off-by: Rob B <github@0x7e.net>
Signed-off-by: Zvezdan Petkovic <zpetkovic@acm.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
14 files changed:
runtime/syntax/python.vim
runtime/syntax/testdir/dumps/python_strings_bytes_01.dump
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 [new file with mode: 0644]
runtime/syntax/testdir/dumps/python_strings_bytes_10.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/python_strings_bytes_11.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/python_strings_bytes_12.dump [new file with mode: 0644]
runtime/syntax/testdir/input/python_strings_bytes.py

index 2881cad464733740418b61c425f55955648cfc91..d123ba4f84c85a56c5464bf9a1595f440b822310 100644 (file)
@@ -1,7 +1,7 @@
 " Vim syntax file
 " Language:    Python
 " Maintainer:  Zvezdan Petkovic <zpetkovic@acm.org>
-" Last Change: 2025 Jul 26
+" Last Change: 2025 Aug 10
 " Credits:     Neil Schemenauer <nas@python.ca>
 "              Dmitry Vasiliev
 "              Rob B
@@ -165,25 +165,25 @@ syn region  pythonFString
       \ start=+\cF\z(['"]\)+
       \ end="\z1"
       \ skip="\\\\\|\\\z1"
-      \ contains=pythonEscape,pythonUnicodeEscape,@Spell
+      \ contains=pythonFStringField,pythonFStringSkip,pythonEscape,pythonUnicodeEscape,@Spell
 syn region  pythonFString
       \ matchgroup=pythonTripleQuotes
       \ start=+\cF\z('''\|"""\)+
       \ end="\z1"
       \ keepend
-      \ contains=pythonEscape,pythonUnicodeEscape,pythonSpaceError,pythonDoctest,@Spell
+      \ contains=pythonFStringField,pythonFStringSkip,pythonEscape,pythonUnicodeEscape,pythonSpaceError,pythonDoctest,@Spell
 syn region  pythonRawFString
       \ matchgroup=pythonQuotes
       \ start=+\c\%(FR\|RF\)\z(['"]\)+
       \ end="\z1"
       \ skip="\\\\\|\\\z1"
-      \ contains=@Spell
+      \ contains=pythonFStringField,pythonFStringSkip,@Spell
 syn region  pythonRawFString
       \ matchgroup=pythonTripleQuotes
       \ start=+\c\%(FR\|RF\)\z('''\|"""\)+
       \ end="\z1"
       \ keepend
-      \ contains=pythonSpaceError,pythonDoctest,@Spell
+      \ contains=pythonFStringField,pythonFStringSkip,pythonSpaceError,pythonDoctest,@Spell
 
 " Bytes
 syn region  pythonBytes
@@ -209,6 +209,24 @@ syn region  pythonRawBytes
       \ end="\z1"
       \ keepend
 
+" F-string replacement fields
+"
+" - Matched parentheses, brackets and braces are ignored
+" - A bare # is ignored to end of line
+" - A bare = (surrounded by optional whitespace) enables debugging
+" - A bare ! prefixes a conversion field
+" - A bare : begins a format specification
+"     - Matched braces inside a format specification are ignored
+"
+syn region  pythonFStringField
+    \ matchgroup=pythonFStringDelimiter
+    \ start=/{/
+    \ skip=/([^)]*)\|\[[^]]*]\|{[^}]*}\|#.*$/
+    \ end=/\%(\s*=\s*\)\=\%(!\a\)\=\%(:\%({[^}]*}\|[^}]*\)\+\)\=}/
+    \ contained
+" Doubled braces and Unicode escapes are not replacement fields
+syn match   pythonFStringSkip  /{{\|\\N{/ transparent contained contains=NONE
+
 syn match   pythonEscape       +\\[abfnrtv'"\\]+ contained
 syn match   pythonEscape       "\\\o\{1,3}" contained
 syn match   pythonEscape       "\\x\x\{2}" contained
@@ -376,6 +394,7 @@ hi def link pythonQuotes            String
 hi def link pythonTripleQuotes         pythonQuotes
 hi def link pythonEscape               Special
 hi def link pythonUnicodeEscape                pythonEscape
+hi def link pythonFStringDelimiter     Special
 if !exists("python_no_number_highlight")
   hi def link pythonNumber             Number
 endif
index f0ce66eba803c53b5fcfdd4bc369c43951823b8d..f8ea6801ad312ae65151eb18e8045d231d642e32 100644 (file)
@@ -17,4 +17,4 @@
 |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
 @75
-@57|1|7|,|1| @10|9|%| 
+@57|1|7|,|1| @10|6|%| 
index b5e152830bc8f1992a3fb4a3b05dc37760d9c953..704cbe34859c3397b9d046fe35f0575b6c87747a 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|2|4|%| 
+@57|3@1|,|1| @9|1|5|%| 
index b3c8d63d208a87b36ed1beb2fe42dbfd0591f2db..610311dac9f87add3da2cf39419bb9a70419747c 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|3|8|%| 
+@57|4|9|,|1| @9|2|4|%| 
index 35eb62bfc6f7b49aa7b5d74e3ee05ddd462e893e..ba0de991dafbdfa58d3b5552ccfb352af5338c89 100644 (file)
@@ -1,20 +1,20 @@
 |#+0#0000e05#ffffff0| |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
 |#+0#0000e05&| |h|t@1|p|s|:|/@1|d|o|c|s|.|p|y|t|h|o|n|.|o|r|g|/|3|/|r|e|f|e|r|e|n|c|e|/|l|e|x|i|c|a|l|_|a|n|a|l|y|s|i|s|.|h|t|m|l|#|f|-|s|t|r|i|n|g|s| +0#0000000&@5
-|t|e|s|t| |=| |f+0#e000002&|'|F|-|s|t|r|i|n|g| |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&|a|n|d| |f|i|e|l|d|s| |{|f|o@1|}| |a|n|d| |{|b|a|r|}|'
-|t+0#0000000&|e|s|t| |=| |F+0#e000002&|"|F|-|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| |{|f|o@1|}| |a|n|d| |{|b|a|r|}|"| +0#0000000&@2
+|t|e|s|t| |=| |f+0#e000002&|'|F|-|s|t|r|i|n|g| |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&|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&
+|t+0#0000000&|e|s|t| |=| |F+0#e000002&|"|F|-|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| |=| |f+0#e000002&|'|F|-|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| |{|f|o@1|}| |a|n|d| |{|b|a|r|}|'| +0#0000000&@35
->t|e|s|t| |=| |F+0#e000002&|"|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| |{|f|o@1|}| |a|n|d| |{|b|a|r|}|"| +0#0000000&@6
+|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
+>t|e|s|t| |=| |F+0#e000002&|"|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&@6
 |t|e|s|t| |=| |f+0#e000002&|'@2|F|-|s|t|r|i|n|g| |w|i|t|h| |q|u|o|t|e|s| |'| |a|n|d| |"| +0#0000000&@35
 |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| |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#0000000&@41
-|a+0#e000002&|n|d| |f|i|e|l|d|s| |{|1|}|,| |{|2|}| |a|n|d| |{|1| +0#0000000&@48
-| +0#e000002&@3|+| +0#0000000&@69
-| +0#e000002&@3|2|}|'@2| +0#0000000&@65
+|a+0#e000002&|n|d| |f|i|e|l|d|s| |{+0#e000e06&|1+0#0000000&|}+0#e000e06&|,+0#e000002&| |{+0#e000e06&|2+0#0000000&|}+0#e000e06&| +0#e000002&|a|n|d| |{+0#e000e06&|1+0#0000000&| @48
+@4|+| @69
+@4|2|}+0#e000e06&|'+0#e000002&@2| +0#0000000&@65
 |t|e|s|t| |=| |F+0#e000002&|"@2|F|-|s|t|r|i|n|g| |w|i|t|h| |q|u|o|t|e|s| |'| |a|n|d| |"| +0#0000000&@35
 |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| |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#0000000&@41
-|a+0#e000002&|n|d| |f|i|e|l|d|s| |{|1|}|,| |{|2|}| |a|n|d| |{|1| +0#0000000&@48
-| +0#e000002&@3|+| +0#0000000&@69
-| +0#e000002&@3|2|}|"@2| +0#0000000&@65
-@57|6@1|,|1| @9|5|3|%| 
+|a+0#e000002&|n|d| |f|i|e|l|d|s| |{+0#e000e06&|1+0#0000000&|}+0#e000e06&|,+0#e000002&| |{+0#e000e06&|2+0#0000000&|}+0#e000e06&| +0#e000002&|a|n|d| |{+0#e000e06&|1+0#0000000&| @48
+@4|+| @69
+@4|2|}+0#e000e06&|"+0#e000002&@2| +0#0000000&@65
+@57|6@1|,|1| @9|3|4|%| 
index d4e8f1b6150fb99b3a0472f0290b8f08d8c39ce4..2c3f5c037241f8448c0fc217852ff98952205abf 100644 (file)
@@ -1,20 +1,20 @@
-| +0#e000002#ffffff0@3|2|}|"@2| +0#0000000&@65
+| +0&#ffffff0@3|2|}+0#e000e06&|"+0#e000002&@2| +0#0000000&@65
 @75
 |#+0#0000e05&| |R|a|w| |f|o|r|m|a|t@1|e|d| |s|t|r|i|n|g| |l|i|t|e|r|a|l|s| +0#0000000&@43
-|t|e|s|t| |=| |f+0#e000002&|r|'|R|a|w| |f|-|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| |{|f|o@1|}| |a|n|d| |{
-|b|a|r|}|'| +0#0000000&@69
->t|e|s|t| |=| |f+0#e000002&|R|"|R|a|w| |f|-|s|t|r|i|n|g| |w|i|t|h| |l|i|t|e|r|a|l| |\|0|4|0| |a|n|d| |\|x|F@1| |a|n|d| |f|i|e|l|d|s| |{|f|o@1|}| |a|n|d| |{|b|a|r
-|}|"| +0#0000000&@72
+|t|e|s|t| |=| |f+0#e000002&|r|'|R|a|w| |f|-|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
+>t|e|s|t| |=| |f+0#e000002&|R|"|R|a|w| |f|-|s|t|r|i|n|g| |w|i|t|h| |l|i|t|e|r|a|l| |\|0|4|0| |a|n|d| |\|x|F@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&@72
 |t|e|s|t| |=| |F+0#e000002&|r|'|R|a|w| |f|-|s|t|r|i|n|g| |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|}| |a|n|d| |f|i|e|l|d|s| |{|f|o@1|}| |a|n|d| |{|b|a|r|}|'| +0#0000000&@30
-|t|e|s|t| |=| |F+0#e000002&|R|"|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| |{|f|o@1|}| |a|n|d| |{|b|a|r|}|"| +0#0000000&@1
-|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| |\|'| |a|n|d| |\|"| |a|n|d| |\|t| |a|n|d| |f|i|e|l|d|s| |{|f|o@1|}| |a|n|d| |{
-|b|a|r|}|'| +0#0000000&@69
-|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| |\|0|4|0| |a|n|d| |\|x|F@1| |a|n|d| |f|i|e|l|d|s| |{|f|o@1|}| |a|n|d| |{|b|a|r
-|}|"| +0#0000000&@72
+|X|C|L|A|M|A|T|I|O|N| |M|A|R|K|}| |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&@30
+|t|e|s|t| |=| |F+0#e000002&|R|"|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| |=| |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| |\|'| |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
+|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| |\|0|4|0| |a|n|d| |\|x|F@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&@72
 |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| |\|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|}| |a|n|d| |f|i|e|l|d|s| |{|f|o@1|}| |a|n|d| |{|b|a|r|}|'| +0#0000000&@30
-|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| |{|f|o@1|}| |a|n|d| |{|b|a|r|}|"| +0#0000000&@1
+|X|C|L|A|M|A|T|I|O|N| |M|A|R|K|}| |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&@30
+|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|6|5|%| 
+@57|8|2|,|1| @9|4|2|%| 
index 27dc71ce96eac49fbe81b7c1170843f0ff6d5795..a9ac329dfccfe0499a65537008a6be1bccc14aa8 100644 (file)
@@ -1,20 +1,20 @@
 |a+0#e000002#ffffff0|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| +0#0000000&@41
-|a+0#e000002&|n|d| |f|i|e|l|d|s| |{|1|}|,| |{|2|}| |a|n|d| |{|1| +0#0000000&@48
-| +0#e000002&@3|+| +0#0000000&@69
-| +0#e000002&@3|2|}|'@2| +0#0000000&@65
+|a+0#e000002&|n|d| |f|i|e|l|d|s| |{+0#e000e06&|1+0#0000000&|}+0#e000e06&|,+0#e000002&| |{+0#e000e06&|2+0#0000000&|}+0#e000e06&| +0#e000002&|a|n|d| |{+0#e000e06&|1+0#0000000&| @48
+@4|+| @69
+@4|2|}+0#e000e06&|'+0#e000002&@2| +0#0000000&@65
 >t|e|s|t| |=| |R+0#e000002&|F|"@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
 |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| |{|1|}|,| |{|2|}| |a|n|d| |{|1| +0#0000000&@48
-| +0#e000002&@3|+| +0#0000000&@69
-| +0#e000002&@3|2|}|"@2| +0#0000000&@65
+|a+0#e000002&|n|d| |f|i|e|l|d|s| |{+0#e000e06&|1+0#0000000&|}+0#e000e06&|,+0#e000002&| |{+0#e000e06&|2+0#0000000&|}+0#e000e06&| +0#e000002&|a|n|d| |{+0#e000e06&|1+0#0000000&| @48
+@4|+| @69
+@4|2|}+0#e000e06&|"+0#e000002&@2| +0#0000000&@65
 @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
-|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|4|0| +0#e000002&|a|n|d| |\+0#e000e06&|x|F@1|"+0#e000002&| +0#0000000&@32
-|t|e|s|t| |=| |b+0#e000002&|'|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&@65
-|t|e|s|t| |=| |B+0#e000002&|"|B|y|t|e|s| |w|i|t|h| |e|s|c|a|p|e|d| |\+0#e000e06&@1| +0#e000002&|b|a|c|k|s|l|a|s|h| |a|n|d| |i|g|n|o|r|e|d| |\+0#e000e06&| +0#0000000&@20
-|n+0#e000002&|e|w|l|i|n|e|"| +0#0000000&@66
-@57|9|5|,|1| @9|7|8|%| 
+|#+0#0000e05&| |F|-|s|t|r|i|n|g| |r|e|p|l|a|c|e|m|e|n|t| |f|i|e|l|d|s| +0#0000000&@45
+|t|e|s|t| |=| |f+0#e000002&|"|S|t|r|i|n|g| |i|s| |{+0#e000e06&| +0#0000000&@54
+@4|"|o|n|e| |p|l|u|s| |"| @59
+@4|"|t|w|o| |p|l|u|s| |"| @59
+@4|"|t|h|r|e@1|"|}+0#e000e06&|"+0#e000002&| +0#0000000&@61
+|t|e|s|t| |=| |f+0#e000002&|"|N|u|m|b|e|r| |i|s| |{+0#e000e06&| +0#0000000&@54
+@4|1| |+| @67
+@57|9|5|,|1| @9|5|0|%| 
index c51fbaeedfb489c4110cc5ef8c79d5da5aef1cd7..7ada66081a82f30c200adc0c38f912eedf4844c5 100644 (file)
@@ -1,20 +1,20 @@
-|n+0#e000002#ffffff0|e|w|l|i|n|e|"| +0#0000000&@66
-|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| |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
-|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| |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
-@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
-|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| |\|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
-@57|1@1|2|,|1| @8|9|2|%| 
+| +0&#ffffff0@3|1| |+| @67
+@4|2| |+| @67
+@4|3|}+0#e000e06&|"+0#e000002&| +0#0000000&@67
+|t|e|s|t| |=| |f+0#e000002&|"|a|b|c|{+0#e000e06&|a+0#0000000&| |#| |T|h|i|s| |i|s| |a| |c|o|m@1|e|n|t| |}| @38
+@4|+| |1|}+0#e000e06&|"+0#e000002&| +0#0000000&@65
+>t|e|s|t| |=| |f+0#e000002&|"|d|e|f|{+0#e000e06&|a+0#0000000&| |#| |S|o| |i|s| |t|h|i|s| |:| @45
+@4|+| |2|}+0#e000e06&|"+0#e000002&| +0#0000000&@65
+|t|e|s|t| |=| |f+0#e000002&|"|g|h|i|{+0#e000e06&|a+0#0000000&| |#| |A|n|d| |t|h|i|s| |"| @47
+@4|+| |3|}+0#e000e06&|"+0#e000002&| +0#0000000&@65
+|t|e|s|t| |=| |f+0#e000002&|"|H|e| |s|a|i|d| |h|i|s| |n|a|m|e| |i|s| |{+0#e000e06&|n+0#0000000&|a|m|e|!+0#e000e06&|r|}|.+0#e000002&|"| +0#0000000&@35
+|t|e|s|t| |=| |f+0#e000002&|"|H|e| |s|a|i|d| |h|i|s| |n|a|m|e| |i|s| |{+0#e000e06&|r+0#0000000&|e|p|r|(|n|a|m|e|)|}+0#e000e06&|.+0#e000002&|"| +0#0000000&@31
+|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|}@1|"+0#e000002&| +0#0000000&@41
+|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|}|.|{|p|r|e|c|i|s|i|o|n|}|}+0#e000002&|"| +0#0000000&@29
+|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|}|}+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
+|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&@51
+|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&@50
+|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&@49
+@57|1@1|3|,|1| @8|6|1|%| 
index 82fb1ccb52cf7f63df49aba3cc8c933fd6e9c080..40ef0ecdc263bbfcdca60adb486d5a97c6942309 100644 (file)
@@ -1,20 +1,20 @@
-|t+0&#ffffff0|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
-|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
-|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
-|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
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-| +0#0000000&@56|1|2|7|,|1| @8|B|o|t
+|t+0&#ffffff0|e|s|t| |=| |f+0#e000002&|"|{+0#e000e06&|n+0#0000000&|u|m|b|e|r|:+0#e000e06&| |<|+|#|0|x|}|"+0#e000002&| +0#0000000&@49
+|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&@51
+|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&@50
+|t|e|s|t| |=| |f+0#e000002&|"|{+0#e000e06&|s+0#0000000&|t|r|i|n|g|=+0#e000e06&|}|"+0#e000002&| +0#0000000&@55
+|t|e|s|t| |=| |f+0#e000002&|"|{+0#e000e06&|s+0#0000000&|t|r|i|n|g|=+0#e000e06&|!|r|}|"+0#e000002&| +0#0000000&@53
+>t|e|s|t| |=| |f+0#e000002&|"|{+0#e000e06&|s+0#0000000&|t|r|i|n|g|=+0#e000e06&|:|2|0|}|"+0#e000002&| +0#0000000&@52
+|t|e|s|t| |=| |f+0#e000002&|"|{+0#e000e06&|s+0#0000000&|t|r|i|n|g|=+0#e000e06&|!|r|:|2|0|}|"+0#e000002&| +0#0000000&@50
+|t|e|s|t| |=| |f+0#e000002&|"|{+0#e000e06&|s+0#0000000&|t|r|i|n|g| +0#e000e06&|=| |}|"+0#e000002&| +0#0000000&@53
+|t|e|s|t| |=| |f+0#e000002&|"|{+0#e000e06&|s+0#0000000&|t|r|i|n|g| +0#e000e06&|=| |!|r|}|"+0#e000002&| +0#0000000&@51
+|t|e|s|t| |=| |f+0#e000002&|"|{+0#e000e06&|s+0#0000000&|t|r|i|n|g| +0#e000e06&|=| |:|2|0|}|"+0#e000002&| +0#0000000&@50
+|t|e|s|t| |=| |f+0#e000002&|"|{+0#e000e06&|s+0#0000000&|t|r|i|n|g| +0#e000e06&|=| |!|r|:|2|0|}|"+0#e000002&| +0#0000000&@48
+|t|e|s|t| |=| |f+0#e000002&|"|a|b|c| |{+0#e000e06&|a+0#0000000&|[|"|x|"|]|}+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#0000000&|\|n|"|.|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
+|t|e|s|t| |=| |f+0#e000002&|"|T|o|d|a|y|'|s| |f|o|r|m|a|t@1|e|d| |d|a|t|e| |i|s| |{+0#e000e06&|d+0#0000000&|a|t|e|t|i|m|e|.|n|o|w|(|)|:+0#e000e06&|%|Y|-|%|m|-|%|d| |%|H|:|%|M|:|%|S|}|"+0#e000002&| +0#0000000&@4
+|t|e|s|t| |=| |f+0#e000002&|"|D|a|t|e| |i|s| |{+0#e000e06&|d+0#0000000&|a|t|e|t|i|m|e|.|d|a|t|e|t|i|m|e|(|2|0|1|0|,| |7|,| |4|,| |1|2|,| |1|5|,| |5|8|)|}+0#e000e06&|"+0#e000002&| +0#0000000&@13
+|t|e|s|t| |=| |f+0#e000002&|"|F|o|r|m|a|t@1|e|d| |d|a|t|e| |i|s| |{+0#e000e06&|d+0#0000000&|a|t|e|t|i|m|e|.|d|a|t|e|t|i|m|e|(|2|0|1|0|,| |7|,| |4|,| |1|2|,| |1|5|,| |5|8|)|:+0#e000e06&|%|Y|-|%|m
+|-|%|d| |%|H|:|%|M|:|%|S|}|"+0#e000002&| +0#0000000&@60
+|t|e|s|t| |=| |f+0#e000002&|"|L|a|m|b|d|a| |r|e|t|u|r|n|s| |{+0#e000e06&|(+0#0000000&|l|a|m|b|d|a| |x|:| |x|*@1|2|)|}+0#e000e06&|"+0#e000002&| +0#0000000&@31
+@57|1|3|1|,|1| @8|7|1|%
diff --git a/runtime/syntax/testdir/dumps/python_strings_bytes_09.dump b/runtime/syntax/testdir/dumps/python_strings_bytes_09.dump
new file mode 100644 (file)
index 0000000..9c9847d
--- /dev/null
@@ -0,0 +1,20 @@
+|t+0&#ffffff0|e|s|t| |=| |f+0#e000002&|"|L|a|m|b|d|a| |r|e|t|u|r|n|s| |{+0#e000e06&|(+0#0000000&|l|a|m|b|d|a| |x|:| |x|*@1|2|)|}+0#e000e06&|"+0#e000002&| +0#0000000&@31
+|t|e|s|t| |=| |f+0#e000002&|"|Z|e|r|o| |p|a|d@1|e|d| |l|a|m|b|d|a| |r|e|t|u|r|n|s| |{+0#e000e06&|(+0#0000000&|l|a|m|b|d|a| |x|:| |x|*@1|2|)|:+0#e000e06&|0|9|}|"+0#e000002&| +0#0000000&@16
+|t|e|s|t| |=| |f+0#e000002&|"|S|p|a|c|e| |p|a|d@1|e|d| |l|a|m|b|d|a| |r|e|t|u|r|n|s| |{+0#e000e06&|(+0#0000000&|l|a|m|b|d|a| |x|:| |x|*@1|2|)|:+0#e000e06&|{|w|i|d|t|h|}@1|"+0#e000002&| +0#0000000&@10
+|t|e|s|t| |=| |f+0#e000002&|"|L|i|s|t| |c|o|p|y| |i|s| |{+0#e000e06&|i+0#0000000&|t|e|m|s|[|:|]|}+0#e000e06&|"+0#e000002&| +0#0000000&@41
+|t|e|s|t| |=| |f+0#e000002&|"|L|i|s|t| |s|l|i|c|e| |i|s| |{+0#e000e06&|i+0#0000000&|t|e|m|s|[|1|:|]|}+0#e000e06&|"+0#e000002&| +0#0000000&@39
+>t|e|s|t| |=| |f+0#e000002&|"|L|i|s|t| |s|l|i|c|e| |i|s| |{+0#e000e06&|i+0#0000000&|t|e|m|s|[|:|9|]|}+0#e000e06&|"+0#e000002&| +0#0000000&@39
+|t|e|s|t| |=| |f+0#e000002&|"|L|i|s|t| |e|l|e|m|e|n|t|s| |a|r|e| |{+0#e000e06&|i+0#0000000&|t|e|m|s|[|:|2|:|]|}+0#e000e06&|"+0#e000002&| +0#0000000&@34
+|t|e|s|t| |=| |f+0#e000002&|"|P|a|d@1|e|d| |l|i|s|t| |c|o|p|y| |i|s| |{+0#e000e06&|i+0#0000000&|t|e|m|s|[|:|]|:+0#e000e06&|9@1|}|"+0#e000002&| +0#0000000&@31
+|t|e|s|t| |=| |f+0#e000002&|"|L|e|f|t|-|a|l|i|g|n|e|d| |l|i|s|t| |s|l|i|c|e| |i|s| |{+0#e000e06&|i+0#0000000&|t|e|m|s|[|1|:|]|:+0#e000e06&|<|9@1|}|"+0#e000002&| +0#0000000&@22
+|t|e|s|t| |=| |f+0#e000002&|"|R|i|g|h|t| |a|l|i|g|n|e|d| |l|i|s|t| |s|l|i|c|e| |i|s| |{+0#e000e06&|i+0#0000000&|t|e|m|s|[|:|9|]|:+0#e000e06&|>|9@1|}|"+0#e000002&| +0#0000000&@21
+|t|e|s|t| |=| |f+0#e000002&|"|C|e|n|t|e|r|-|a|l|i|g|n|e|d| |l|i|s|t| |e|l|e|m|e|n|t|s| |a|r|e| |{+0#e000e06&|i+0#0000000&|t|e|m|s|[|:|2|:|]|:+0#e000e06&|^|9@1|}|"+0#e000002&| +0#0000000&@15
+|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#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#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#e000e06&|"+0#e000002&| +0#0000000&@40
+|t|e|s|t| |=| |f+0#e000002&|"|D|e|b|u|g| |e|x|p|r|e|s@1|i|o|n| |i|s| |{+0#e000e06&|x+0#0000000&| |=@1| |1|=+0#e000e06&|}|"+0#e000002&| +0#0000000&@35
+|t|e|s|t| |=| |f+0#e000002&|"|D|e|b|u|g| |e|x|p|r|e|s@1|i|o|n| |i|s| |{+0#e000e06&|x+0#0000000&| |!|=| |1|=+0#e000e06&|}|"+0#e000002&| +0#0000000&@35
+|t|e|s|t| |=| |f+0#e000002&|"|D|e|b|u|g| |e|x|p|r|e|s@1|i|o|n| |i|s| |{+0#e000e06&|(+0#0000000&|x| |:|=| |1|)|=+0#e000e06&|}|"+0#e000002&| +0#0000000&@33
+|t|e|s|t| |=| |f+0#e000002&|"|L|i|s|t| |c|o|m|p|r|e|h|e|n|s|i|o|n| |r|e|t|u|r|n|s| |{+0#e000e06&| +0#0000000&|[|x|*@1|2| |f|o|r| |x| |i|n| |r|a|n|g|e|(|1|0|)|]| |}+0#e000e06&|"+0#e000002&| +0#0000000&@8
+|t|e|s|t| |=| |f+0#e000002&|"|P|a|d@1|e|d| |l|i|s|t| |c|o|m|p|r|e|h|e|n|s|i|o|n| |r|e|t|u|r|n|s| |{+0#e000e06&| +0#0000000&|[|x|*@1|2| |f|o|r| |x| |i|n| |r|a|n|g|e|(|1|0|)|]| |:+0#e000e06&|@+0#4040ff13&@2
+| +0#0000000&@56|1|4|8|,|1| @8|8|0|%| 
diff --git a/runtime/syntax/testdir/dumps/python_strings_bytes_10.dump b/runtime/syntax/testdir/dumps/python_strings_bytes_10.dump
new file mode 100644 (file)
index 0000000..15781d7
--- /dev/null
@@ -0,0 +1,20 @@
+|t+0&#ffffff0|e|s|t| |=| |f+0#e000002&|"|P|a|d@1|e|d| |l|i|s|t| |c|o|m|p|r|e|h|e|n|s|i|o|n| |r|e|t|u|r|n|s| |{+0#e000e06&| +0#0000000&|[|x|*@1|2| |f|o|r| |x| |i|n| |r|a|n|g|e|(|1|0|)|]| |:+0#e000e06&|9@1|}
+|"+0#e000002&| +0#0000000&@73
+|t|e|s|t| |=| |f+0#e000002&|"|D|i|c|t| |c|o|m|p|r|e|h|e|n|s|i|o|n| |r|e|t|u|r|n|s| |{+0#e000e06&| +0#0000000&|{|x|:| |x|*@1|2| |f|o|r| |x| |i|n| |r|a|n|g|e|(|1|0|)|}| |}+0#e000e06&|"+0#e000002&| +0#0000000&@5
+|t|e|s|t| |=| |f+0#e000002&|"|P|a|d@1|e|d| |d|i|c|t| |c|o|m|p|r|e|h|e|n|s|i|o|n| |r|e|t|u|r|n|s| |{+0#e000e06&| +0#0000000&|{|x|:| |x|*@1|2| |f|o|r| |x| |i|n| |r|a|n|g|e|(|1|0|)|}| |:+0#e000e06&
+|9@1|}|"+0#e000002&| +0#0000000&@70
+> @74
+|#+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
+|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|4|0| +0#e000002&|a|n|d| |\+0#e000e06&|x|F@1|"+0#e000002&| +0#0000000&@32
+|t|e|s|t| |=| |b+0#e000002&|'|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&@65
+|t|e|s|t| |=| |B+0#e000002&|"|B|y|t|e|s| |w|i|t|h| |e|s|c|a|p|e|d| |\+0#e000e06&@1| +0#e000002&|b|a|c|k|s|l|a|s|h| |a|n|d| |i|g|n|o|r|e|d| |\+0#e000e06&| +0#0000000&@20
+|n+0#e000002&|e|w|l|i|n|e|"| +0#0000000&@66
+|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| |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
+|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| |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
+@57|1|6|4|,|0|-|1| @6|8|9|%| 
diff --git a/runtime/syntax/testdir/dumps/python_strings_bytes_11.dump b/runtime/syntax/testdir/dumps/python_strings_bytes_11.dump
new file mode 100644 (file)
index 0000000..297f46c
--- /dev/null
@@ -0,0 +1,20 @@
+|a+0#e000002#ffffff0|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
+@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
+|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| |\|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
+|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
+|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
+|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
+@57|1|8|1|,|1| @8|9|8|%| 
diff --git a/runtime/syntax/testdir/dumps/python_strings_bytes_12.dump b/runtime/syntax/testdir/dumps/python_strings_bytes_12.dump
new file mode 100644 (file)
index 0000000..d2cf6ba
--- /dev/null
@@ -0,0 +1,20 @@
+|t+0&#ffffff0|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
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|1|9|4|,|1| @8|B|o|t| 
index 02eb1b00e77033402ff3749e0af030be9b5fe879..1b87fd4ac7ee19bedf16c54247b2736670320569 100644 (file)
@@ -99,6 +99,69 @@ and fields {1}, {2} and {1
     +
     2}"""
 
+# F-string replacement fields
+test = f"String is {
+    "one plus "
+    "two plus "
+    "three"}"
+test = f"Number is {
+    1 +
+    2 +
+    3}"
+test = f"abc{a # This is a comment }
+    + 1}"
+test = f"def{a # So is this :
+    + 2}"
+test = f"ghi{a # And this "
+    + 3}"
+test = f"He said his name is {name!r}."
+test = f"He said his name is {repr(name)}."
+test = f"result: {value:{width}}"
+test = f"result: {value:{width}.{precision}}"
+test = f"result: {value:{width:d}.{precision!s}}"
+test = f"result: {value:{options}{width}{grouping}{precision}{type}}"
+test = f"{number:#0x}"
+test = f"{number:+#0x}"
+test = f"{number:<+#0x}"
+test = f"{number: <+#0x}"
+test = f"{number:<#0x}"
+test = f"{number: <#0x}"
+test = f"{string=}"
+test = f"{string=!r}"
+test = f"{string=:20}"
+test = f"{string=!r:20}"
+test = f"{string = }"
+test = f"{string = !r}"
+test = f"{string = :20}"
+test = f"{string = !r:20}"
+test = f"abc {a["x"]} def"
+test = f"List contains:\n{"\n".join(a)}"
+test = f"Today's date is {datetime.now()}"
+test = f"Today's formatted date is {datetime.now():%Y-%m-%d %H:%M:%S}"
+test = f"Date is {datetime.datetime(2010, 7, 4, 12, 15, 58)}"
+test = f"Formatted date is {datetime.datetime(2010, 7, 4, 12, 15, 58):%Y-%m-%d %H:%M:%S}"
+test = f"Lambda returns {(lambda x: x**2)}"
+test = f"Zero padded lambda returns {(lambda x: x**2):09}"
+test = f"Space padded lambda returns {(lambda x: x**2):{width}}"
+test = f"List copy is {items[:]}"
+test = f"List slice is {items[1:]}"
+test = f"List slice is {items[:9]}"
+test = f"List elements are {items[:2:]}"
+test = f"Padded list copy is {items[:]:99}"
+test = f"Left-aligned list slice is {items[1:]:<99}"
+test = f"Right aligned list slice is {items[:9]:>99}"
+test = f"Center-aligned list elements are {items[:2:]:^99}"
+test = f"Expression is {x == 1}"
+test = f"Expression is {x != 1}"
+test = f"Expression is {(x := 1)}"
+test = f"Debug expression is {x == 1=}"
+test = f"Debug expression is {x != 1=}"
+test = f"Debug expression is {(x := 1)=}"
+test = f"List comprehension returns { [x**2 for x in range(10)] }"
+test = f"Padded list comprehension returns { [x**2 for x in range(10)] :99}"
+test = f"Dict comprehension returns { {x: x**2 for x in range(10)} }"
+test = f"Padded dict comprehension returns { {x: x**2 for x in range(10)} :99}"
+
 # Bytes
 test = b'Bytes with escapes \' and \" and \t'
 test = B"Bytes with escapes \040 and \xFF"