mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
runtime(python): Highlight f-strings in Python
fixes: #10734 fixes: #14033 closes: #17767 Signed-off-by: Rob B <github@0x7e.net> Signed-off-by: Zvezdan Petkovic <zpetkovic@acm.org> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
97501afda3
commit
b7fc24d3a3
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: Python
|
||||
" Maintainer: Zvezdan Petkovic <zpetkovic@acm.org>
|
||||
" Last Change: 2025 Jul 14
|
||||
" Last Change: 2025 Jul 17
|
||||
" Credits: Neil Schemenauer <nas@python.ca>
|
||||
" Dmitry Vasiliev
|
||||
" Rob B
|
||||
@@ -156,6 +156,33 @@ syn region pythonRawString matchgroup=pythonTripleQuotes
|
||||
\ start=+[rR]\z('''\|"""\)+ end="\z1" keepend
|
||||
\ contains=pythonSpaceError,pythonDoctest,@Spell
|
||||
|
||||
" Formatted string literals (f-strings)
|
||||
" https://docs.python.org/3/reference/lexical_analysis.html#f-strings
|
||||
syn region pythonFString
|
||||
\ matchgroup=pythonQuotes
|
||||
\ start=+\cF\z(['"]\)+
|
||||
\ end="\z1"
|
||||
\ skip="\\\\\|\\\z1"
|
||||
\ contains=pythonEscape,pythonUnicodeEscape,@Spell
|
||||
syn region pythonFString
|
||||
\ matchgroup=pythonTripleQuotes
|
||||
\ start=+\cF\z('''\|"""\)+
|
||||
\ end="\z1"
|
||||
\ keepend
|
||||
\ contains=pythonEscape,pythonUnicodeEscape,pythonSpaceError,pythonDoctest,@Spell
|
||||
syn region pythonRawFString
|
||||
\ matchgroup=pythonQuotes
|
||||
\ start=+\c\%(FR\|RF\)\z(['"]\)+
|
||||
\ end="\z1"
|
||||
\ skip="\\\\\|\\\z1"
|
||||
\ contains=@Spell
|
||||
syn region pythonRawFString
|
||||
\ matchgroup=pythonTripleQuotes
|
||||
\ start=+\c\%(FR\|RF\)\z('''\|"""\)+
|
||||
\ end="\z1"
|
||||
\ keepend
|
||||
\ contains=pythonSpaceError,pythonDoctest,@Spell
|
||||
|
||||
" Bytes
|
||||
syn region pythonBytes
|
||||
\ matchgroup=pythonQuotes
|
||||
@@ -338,6 +365,8 @@ hi def link pythonComment Comment
|
||||
hi def link pythonTodo Todo
|
||||
hi def link pythonString String
|
||||
hi def link pythonRawString String
|
||||
hi def link pythonFString String
|
||||
hi def link pythonRawFString String
|
||||
hi def link pythonBytes String
|
||||
hi def link pythonRawBytes String
|
||||
hi def link pythonQuotes String
|
||||
|
@@ -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| @9|1|5|%|
|
||||
@57|1|7|,|1| @10|9|%|
|
||||
|
@@ -1,20 +1,20 @@
|
||||
| +0&#ffffff0@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
|
||||
|#+0#0000e05&| |U|n|i|c|o|d|e| |l|i|t|e|r|a|l|s|:| |P|r|e|f|i|x| |i|s| |a|l@1|o|w|e|d| |b|u|t| |i|g|n|o|r|e|d| |(|h|t@1|p|s|:|/@1|p|e|p|s|.|p|y|t|h|o|n|.|o|r|g|/
|
||||
|p|e|p|-|0|4|1|4|)| +0#0000000&@65
|
||||
|t|e|s|t| |=| |u+0#e000002&|'|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&| +0#0000000&@28
|
||||
|t|e|s|t| |=| |U+0#e000002&|"|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&| +0#0000000&@31
|
||||
>t|e|s|t| |=| |u+0#e000002&|'|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&| +0#0000000&@64
|
||||
|t|e|s|t| |=| |U+0#e000002&|"|S|t|r|i|n|g| |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&@19
|
||||
|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
|
||||
|t|e|s|t| |=| |u+0#e000002&|'@2|S|t|r|i|n|g| |w|i|t|h| |q|u|o|t|e|s| |'| |a|n|d| |"| +0#0000000&@37
|
||||
|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&|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&@38
|
||||
|t|e|s|t| |=| |U+0#e000002&|"@2|S|t|r|i|n|g| |w|i|t|h| |q|u|o|t|e|s| |'| |a|n|d| |"| +0#0000000&@37
|
||||
|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
|
||||
|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#e000002&@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|@+0#4040ff13&@2
|
||||
| +0#0000000&@56|3|4|,|1| @9|3|8|%|
|
||||
|#+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|%|
|
||||
|
@@ -1,20 +1,20 @@
|
||||
|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| |\|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
|
||||
|t+0&#ffffff0|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
|
||||
|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| |\|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&@63
|
||||
|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| |\@1| |b|a|c|k|s|l|a|s|h|e|s| |a|n|d| |l|i|t|e|r|a|l| |\| +0#0000000&@16
|
||||
|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
|
||||
>t|e|s|t| |=| |r|u+0#e000002&|'|I|n|v|a|l|i|d| |s|t|r|i|n|g| |w|i|t|h| |\+0#e000e06&|'| +0#e000002&|a|n|d| |\+0#e000e06&|"| +0#e000002&|a|n|d| |\+0#e000e06&|t|'+0#e000002&| +0#0000000&@27
|
||||
|t|e|s|t| |=| |r|U+0#e000002&|"|I|n|v|a|l|i|d| |s|t|r|i|n|g| |w|i|t|h| |\+0#e000e06&|0|4|0| +0#e000002&|a|n|d| |\+0#e000e06&|x|F@1|"+0#e000002&| +0#0000000&@30
|
||||
|t|e|s|t| |=| |R|u+0#e000002&|'|I|n|v|a|l|i|d| |s|t|r|i|n|g| |w|i|t|h| |\+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&| +0#0000000&@63
|
||||
|t|e|s|t| |=| |R|U+0#e000002&|"|I|n|v|a|l|i|d| |s|t|r|i|n|g| |w|i|t|h| |\+0#e000e06&@1| +0#e000002&|b|a|c|k|s|l|a|s|h|e|s| |a|n|d| |l|i|t|e|r|a|l| |\+0#e000e06&| +0#0000000&@16
|
||||
|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
|
||||
|t|e|s|t| |=| |u|r+0#e000002&|'@2|I|n|v|a|l|i|d| |s|t|r|i|n|g| |w|i|t|h| |'| |a|n|d| |"| +0#0000000&@35
|
||||
|a+0#e000002&|n|d| |\|t| |a|n|d| |\|0|4|0| |a|n|d| |\|x|F@1| +0#0000000&@50
|
||||
|a+0#e000002&|n|d| |\|u|0@1|A|1| |a|n|d| |\|U|0@2|1|0|6|0|5|'@2| +0#0000000&@46
|
||||
|t|e|s|t| |=| |R|U+0#e000002&|"@2|I|n|v|a|l|i|d| |s|t|r|i|n|g| |w|i|t|h| |'| |a|n|d| |"| +0#0000000&@35
|
||||
|a+0#e000002&|n|d| |\+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&@50
|
||||
|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&| |U|n|i|c|o|d|e| |l|i|t|e|r|a|l|s|:| |P|r|e|f|i|x| |i|s| |a|l@1|o|w|e|d| |b|u|t| |i|g|n|o|r|e|d| |(|h|t@1|p|s|:|/@1|p|e|p|s|.|p|y|t|h|o|n|.|o|r|g|/
|
||||
|p|e|p|-|0|4|1|4|)| +0#0000000&@65
|
||||
@57|5|0|,|1| @9|6|0|%|
|
||||
|#+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|%|
|
||||
|
@@ -1,20 +1,20 @@
|
||||
|#+0#0000e05#ffffff0| |U|n|i|c|o|d|e| |l|i|t|e|r|a|l|s|:| |P|r|e|f|i|x| |i|s| |a|l@1|o|w|e|d| |b|u|t| |i|g|n|o|r|e|d| |(|h|t@1|p|s|:|/@1|p|e|p|s|.|p|y|t|h|o|n|.|o|r|g|/
|
||||
|p|e|p|-|0|4|1|4|)| +0#0000000&@65
|
||||
|t|e|s|t| |=| |u+0#e000002&|'|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&| +0#0000000&@28
|
||||
|t|e|s|t| |=| |U+0#e000002&|"|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&| +0#0000000&@31
|
||||
|t|e|s|t| |=| |u+0#e000002&|'|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&| +0#0000000&@64
|
||||
>t|e|s|t| |=| |U+0#e000002&|"|S|t|r|i|n|g| |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&@19
|
||||
|n+0#e000002&|e|w|l|i|n|e|"| +0#0000000&@66
|
||||
|t|e|s|t| |=| |u+0#e000002&|'@2|S|t|r|i|n|g| |w|i|t|h| |q|u|o|t|e|s| |'| |a|n|d| |"| +0#0000000&@37
|
||||
|#+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&|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
|
||||
|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#e000002&@2| +0#0000000&@38
|
||||
|t|e|s|t| |=| |U+0#e000002&|"@2|S|t|r|i|n|g| |w|i|t|h| |q|u|o|t|e|s| |'| |a|n|d| |"| +0#0000000&@37
|
||||
|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
|
||||
|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#e000002&@2| +0#0000000&@38
|
||||
@75
|
||||
|#+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
|
||||
|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| |\|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|@+0#4040ff13&@2
|
||||
| +0#0000000&@56|6|5|,|1| @9|8|1|%|
|
||||
|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|%|
|
||||
|
@@ -1,20 +1,20 @@
|
||||
|t+0&#ffffff0|e|s|t| |=| |U|r+0#e000002&|'|I|n|v|a|l|i|d| |s|t|r|i|n|g| |w|i|t|h| |\|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&@63
|
||||
|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| |\@1| |b|a|c|k|s|l|a|s|h|e|s| |a|n|d| |l|i|t|e|r|a|l| |\| +0#0000000&@16
|
||||
|n+0#e000002&|e|w|l|i|n|e|"| +0#0000000&@66
|
||||
|t|e|s|t| |=| |r|u+0#e000002&|'|I|n|v|a|l|i|d| |s|t|r|i|n|g| |w|i|t|h| |\+0#e000e06&|'| +0#e000002&|a|n|d| |\+0#e000e06&|"| +0#e000002&|a|n|d| |\+0#e000e06&|t|'+0#e000002&| +0#0000000&@27
|
||||
>t|e|s|t| |=| |r|U+0#e000002&|"|I|n|v|a|l|i|d| |s|t|r|i|n|g| |w|i|t|h| |\+0#e000e06&|0|4|0| +0#e000002&|a|n|d| |\+0#e000e06&|x|F@1|"+0#e000002&| +0#0000000&@30
|
||||
|t|e|s|t| |=| |R|u+0#e000002&|'|I|n|v|a|l|i|d| |s|t|r|i|n|g| |w|i|t|h| |\+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&| +0#0000000&@63
|
||||
|t|e|s|t| |=| |R|U+0#e000002&|"|I|n|v|a|l|i|d| |s|t|r|i|n|g| |w|i|t|h| |\+0#e000e06&@1| +0#e000002&|b|a|c|k|s|l|a|s|h|e|s| |a|n|d| |l|i|t|e|r|a|l| |\+0#e000e06&| +0#0000000&@16
|
||||
|n+0#e000002&|e|w|l|i|n|e|"| +0#0000000&@66
|
||||
|t|e|s|t| |=| |u|r+0#e000002&|'@2|I|n|v|a|l|i|d| |s|t|r|i|n|g| |w|i|t|h| |'| |a|n|d| |"| +0#0000000&@35
|
||||
|a+0#e000002&|n|d| |\|t| |a|n|d| |\|0|4|0| |a|n|d| |\|x|F@1| +0#0000000&@50
|
||||
|a+0#e000002&|n|d| |\|u|0@1|A|1| |a|n|d| |\|U|0@2|1|0|6|0|5|'@2| +0#0000000&@46
|
||||
|t|e|s|t| |=| |R|U+0#e000002&|"@2|I|n|v|a|l|i|d| |s|t|r|i|n|g| |w|i|t|h| |'| |a|n|d| |"| +0#0000000&@35
|
||||
|a+0#e000002&|n|d| |\+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&@50
|
||||
|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
|
||||
|~+0#4040ff13&| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
| +0#0000000&@56|8|1|,|1| @9|B|o|t|
|
||||
| +0#e000002#ffffff0@3|2|}|"@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| |\|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
|
||||
|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
|
||||
|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|%|
|
||||
|
20
runtime/syntax/testdir/dumps/python_strings_bytes_06.dump
Normal file
20
runtime/syntax/testdir/dumps/python_strings_bytes_06.dump
Normal file
@@ -0,0 +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
|
||||
>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
|
||||
@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|%|
|
20
runtime/syntax/testdir/dumps/python_strings_bytes_07.dump
Normal file
20
runtime/syntax/testdir/dumps/python_strings_bytes_07.dump
Normal file
@@ -0,0 +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|%|
|
20
runtime/syntax/testdir/dumps/python_strings_bytes_08.dump
Normal file
20
runtime/syntax/testdir/dumps/python_strings_bytes_08.dump
Normal file
@@ -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| |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|
|
@@ -27,37 +27,6 @@ test = R"""Raw string with quotes ' and "
|
||||
and literal \t and \040 and \xFF
|
||||
and literal \u00A1 and \U00010605"""
|
||||
|
||||
# Bytes
|
||||
test = b'Bytes with escapes \' and \" and \t'
|
||||
test = B"Bytes with escapes \040 and \xFF"
|
||||
test = b'Bytes with literal \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK}'
|
||||
test = B"Bytes with escaped \\ backslash and ignored \
|
||||
newline"
|
||||
test = b'''Bytes with quotes ' and "
|
||||
and escapes \t and \040 and \xFF
|
||||
and literal \u00A1 and \U00010605'''
|
||||
test = B"""Bytes with quotes ' and "
|
||||
and escapes \t and \040 and \xFF
|
||||
and literal \u00A1 and \U00010605"""
|
||||
|
||||
# Raw bytes
|
||||
test = br'Raw bytes with literal \' and \" and \t'
|
||||
test = bR"Raw bytes with literal \040 and \xFF"
|
||||
test = Br'Raw bytes with literal \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK}'
|
||||
test = BR"Raw bytes with literal \\ backslashes and literal \
|
||||
newline"
|
||||
test = rb'Raw bytes with literal \' and \" and \t'
|
||||
test = rB"Raw bytes with literal \040 and \xFF"
|
||||
test = Rb'Raw bytes with literal \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK}'
|
||||
test = RB"Raw bytes with literal \\ backslashes and literal \
|
||||
newline"
|
||||
test = br'''Raw bytes with quotes ' and "
|
||||
and literal \t and \040 and \xFF
|
||||
and literal \u00A1 and \U00010605'''
|
||||
test = RB"""Raw bytes with quotes ' and "
|
||||
and literal \t and \040 and \xFF
|
||||
and literal \u00A1 and \U00010605"""
|
||||
|
||||
# Unicode literals: Prefix is allowed but ignored (https://peps.python.org/pep-0414)
|
||||
test = u'String with escapes \' and \" and \t'
|
||||
test = U"String with escapes \040 and \xFF"
|
||||
@@ -88,3 +57,75 @@ and \u00A1 and \U00010605'''
|
||||
test = RU"""Invalid string with ' and "
|
||||
and \t and \040 and \xFF
|
||||
and \u00A1 and \U00010605"""
|
||||
|
||||
# Formatted string literals (f-strings)
|
||||
# https://docs.python.org/3/reference/lexical_analysis.html#f-strings
|
||||
test = f'F-string with escapes \' and \" and \t and fields {foo} and {bar}'
|
||||
test = F"F-string with escapes \040 and \xFF and fields {foo} and {bar}"
|
||||
test = f'F-string with escapes \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK} and fields {foo} and {bar}'
|
||||
test = F"F-string with literal {{field}} and fields {foo} and {bar}"
|
||||
test = f'''F-string with quotes ' and "
|
||||
and escapes \t and \040 and \xFF
|
||||
and escapes \u00A1 and \U00010605
|
||||
and fields {1}, {2} and {1
|
||||
+
|
||||
2}'''
|
||||
test = F"""F-string with quotes ' and "
|
||||
and escapes \t and \040 and \xFF
|
||||
and escapes \u00A1 and \U00010605
|
||||
and fields {1}, {2} and {1
|
||||
+
|
||||
2}"""
|
||||
|
||||
# Raw formatted string literals
|
||||
test = fr'Raw f-string with literal \' and \" and \t and fields {foo} and {bar}'
|
||||
test = fR"Raw f-string with literal \040 and \xFF and fields {foo} and {bar}"
|
||||
test = Fr'Raw f-string with literal \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK} and fields {foo} and {bar}'
|
||||
test = FR"Raw f-string with literal {{field}} and fields {foo} and {bar}"
|
||||
test = rf'Raw f-string with literal \' and \" and \t and fields {foo} and {bar}'
|
||||
test = rF"Raw f-string with literal \040 and \xFF and fields {foo} and {bar}"
|
||||
test = Rf'Raw f-string with literal \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK} and fields {foo} and {bar}'
|
||||
test = RF"Raw f-string with literal {{field}} and fields {foo} and {bar}"
|
||||
test = fr'''Raw f-string with quotes ' and "
|
||||
and literal \t and \040 and \xFF
|
||||
and literal \u00A1 and \U00010605
|
||||
and fields {1}, {2} and {1
|
||||
+
|
||||
2}'''
|
||||
test = RF"""Raw f-string with quotes ' and "
|
||||
and literal \t and \040 and \xFF
|
||||
and literal \u00A1 and \U00010605
|
||||
and fields {1}, {2} and {1
|
||||
+
|
||||
2}"""
|
||||
|
||||
# Bytes
|
||||
test = b'Bytes with escapes \' and \" and \t'
|
||||
test = B"Bytes with escapes \040 and \xFF"
|
||||
test = b'Bytes with literal \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK}'
|
||||
test = B"Bytes with escaped \\ backslash and ignored \
|
||||
newline"
|
||||
test = b'''Bytes with quotes ' and "
|
||||
and escapes \t and \040 and \xFF
|
||||
and literal \u00A1 and \U00010605'''
|
||||
test = B"""Bytes with quotes ' and "
|
||||
and escapes \t and \040 and \xFF
|
||||
and literal \u00A1 and \U00010605"""
|
||||
|
||||
# Raw bytes
|
||||
test = br'Raw bytes with literal \' and \" and \t'
|
||||
test = bR"Raw bytes with literal \040 and \xFF"
|
||||
test = Br'Raw bytes with literal \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK}'
|
||||
test = BR"Raw bytes with literal \\ backslashes and literal \
|
||||
newline"
|
||||
test = rb'Raw bytes with literal \' and \" and \t'
|
||||
test = rB"Raw bytes with literal \040 and \xFF"
|
||||
test = Rb'Raw bytes with literal \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK}'
|
||||
test = RB"Raw bytes with literal \\ backslashes and literal \
|
||||
newline"
|
||||
test = br'''Raw bytes with quotes ' and "
|
||||
and literal \t and \040 and \xFF
|
||||
and literal \u00A1 and \U00010605'''
|
||||
test = RB"""Raw bytes with quotes ' and "
|
||||
and literal \t and \040 and \xFF
|
||||
and literal \u00A1 and \U00010605"""
|
||||
|
Reference in New Issue
Block a user