Merge remote-tracking branch 'upstream/master' into Issue-124-handle-async-for-GET_AITER_GET_ANEXT

Conflicts:
	ASTree.cpp
This commit is contained in:
Aralox
2020-10-21 19:34:37 +11:00
15 changed files with 326 additions and 24 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,22 @@
cookie = 1
constant_headers_1 = {
'Accept': 'application/json',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'es,ca;q=0.9,en;q=0.8',
'Cache-Control': 'no-cache',
'Connection': 'keep-alive',
'Content-Type': 'application/x-www-form-urlencoded',
'Pragma': 'no-cache',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36',
'Cookie': cookie }
constant_headers_2 = {
'Accept': 'application/json',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'es,ca;q=0.9,en;q=0.8',
'Cache-Control': 'no-cache',
'Connection': 'keep-alive',
'Content-Type': 'application/x-www-form-urlencoded',
'Pragma': 'no-cache',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36',
'Cookie': 'constant cookie' }

37
tests/input/f-string.py Normal file
View File

@@ -0,0 +1,37 @@
var1 = 'x'
var2 = 'y'
x = s1 = var3 = 1.23456
a = 15
some_dict = {}
some_dict[2] = 3
f''
f'''{123}'''
f'''{123}{var1}'''
f'''{123}ok'''
f'''ok{123}'''
assigned = f'''{123}'''
print(f'''{123}''')
print(f'''{123}{123}{var3}{123}''')
print(f'''{var3}''')
print(f'''{var3:4.5}''')
print(f'''f-string {123}''')
print(fr'{123}:\s+')
print(f'x{12}' * 3)
print(f'''f-string. \t\tformat value 0: {var1}, 1 (!s): {var2!s}, 2 (!r): {var2!r}, 3 (!a): {var2!a}, 4: {var3:6.3}, constant: {123}. End.''')
print('percent format %d ' % 444 + f'''f-string {123} and {var1!s}''' + f''' add another f-str {var3:2.3}''' + ' regular string ' * 2)
print(f"""'''{'single quoted string'} 'singles in f-string' {"single quote ' inside"} "doubles in f-string" {"double quoted string"} " both ' {'double quotes " inside'}'''""")
print(f'''"""{'single quoted string'} 'singles in f-string' {"single quote ' inside"} "doubles in f-string" {"double quoted string"} " both ' {'double quotes " inside'}"""''')
print(f'single quote \t\t{var1}"{var1!s}" \'{var2!a}{var3:.2f}\' """{var1!r}""" \'\'\'{var2}\'\'\'')
print(f"double quote \t\t{var1}\"{var1!s}\" '{var2!a}{var3:.2f}' \"\"\"{var1!r}\"\"\" '''{var2}'''")
print(f'{var3 * x} {var3:.2f} {var3:.5f} {x:02} {x*x:3} {x*x*x:4} {s1:>10} {a:x} {a:o} {a:e}')
print(f'''some {{braces}} {"inner literal: {braces} {{double braces}}"}''')
print(f'''f-string dict {some_dict[2]} and {{function call in expression}}: {max([1,20,3])}''')
print(f'{(lambda x: x*2)(3)}')
msg = (
f'a {var1}'
f'cool'
f'multiline {var2}\n'
f'f-string {var3}'
)
print(f'{now:%Y-%m-%d %H:%M}')

View File

@@ -0,0 +1,3 @@
cookie = 1 <EOL>
constant_headers_1 = { 'Accept' : 'application/json' , 'Accept-Encoding' : 'gzip, deflate, br' , 'Accept-Language' : 'es,ca;q=0.9,en;q=0.8' , 'Cache-Control' : 'no-cache' , 'Connection' : 'keep-alive' , 'Content-Type' : 'application/x-www-form-urlencoded' , 'Pragma' : 'no-cache' , 'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36' , 'Cookie' : cookie } <EOL>
constant_headers_2 = { 'Accept' : 'application/json' , 'Accept-Encoding' : 'gzip, deflate, br' , 'Accept-Language' : 'es,ca;q=0.9,en;q=0.8' , 'Cache-Control' : 'no-cache' , 'Connection' : 'keep-alive' , 'Content-Type' : 'application/x-www-form-urlencoded' , 'Pragma' : 'no-cache' , 'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36' , 'Cookie' : 'constant cookie' } <EOL>

View File

@@ -0,0 +1,33 @@
var1 = 'x' <EOL>
var2 = 'y' <EOL>
x = 1.23456 <EOL>
s1 = 1.23456 <EOL>
var3 = 1.23456 <EOL>
a = 15 <EOL>
some_dict = { } <EOL>
some_dict [ 2 ] = 3 <EOL>
f'' <EOL>
f'{123}' <EOL>
f'{123}{var1}' <EOL>
f'{123}ok' <EOL>
f'ok{123}' <EOL>
assigned = f'{123}' <EOL>
print ( f'{123}' ) <EOL>
print ( f'{123}{123}{var3}{123}' ) <EOL>
print ( f'{var3}' ) <EOL>
print ( f'{var3:4.5}' ) <EOL>
print ( f'f-string {123}' ) <EOL>
print ( f'{123}:\\s+' ) <EOL>
print ( f'x{12}' * 3 ) <EOL>
print ( f'f-string. \t\tformat value 0: {var1}, 1 (!s): {var2!s}, 2 (!r): {var2!r}, 3 (!a): {var2!a}, 4: {var3:6.3}, constant: {123}. End.' ) <EOL>
print ( 'percent format %d ' % 444 + f'f-string {123} and {var1!s}' + f' add another f-str {var3:2.3}' + ' regular string regular string ' ) <EOL>
print ( f'\'\'\'{\'single quoted string\'} \'singles in f-string\' {"single quote \' inside"} "doubles in f-string" {\'double quoted string\'} " both \' {\'double quotes " inside\'}\'\'\'' ) <EOL>
print ( f'"""{\'single quoted string\'} \'singles in f-string\' {"single quote \' inside"} "doubles in f-string" {\'double quoted string\'} " both \' {\'double quotes " inside\'}"""' ) <EOL>
print ( f'single quote \t\t{var1}"{var1!s}" \'{var2!a}{var3:.2f}\' """{var1!r}""" \'\'\'{var2}\'\'\'' ) <EOL>
print ( f'double quote \t\t{var1}"{var1!s}" \'{var2!a}{var3:.2f}\' """{var1!r}""" \'\'\'{var2}\'\'\'' ) <EOL>
print ( f'{var3 * x} {var3:.2f} {var3:.5f} {x:02} {x * x:3} {x * x * x:4} {s1:>10} {a:x} {a:o} {a:e}' ) <EOL>
print ( f'some {{braces}} {\'inner literal: {braces} {{double braces}}\'}' ) <EOL>
print ( f'f-string dict {some_dict[2]} and {{function call in expression}}: {max([\n 1,\n 20,\n 3])}' ) <EOL>
print ( f'{(lambda x: x * 2)(3)}' ) <EOL>
msg = f'a {var1}coolmultiline {var2}\nf-string {var3}' <EOL>
print ( f'{now:%Y-%m-%d %H:%M}' ) <EOL>