mirror of
https://github.com/licsber/micropython.git
synced 2024-09-21 01:20:23 +08:00
25 lines
511 B
Python
25 lines
511 B
Python
|
# parser tests
|
||
|
|
||
|
# completely empty string
|
||
|
# uPy and CPy differ for this case
|
||
|
#try:
|
||
|
# compile("", "stdin", "single")
|
||
|
#except SyntaxError:
|
||
|
# print("SyntaxError")
|
||
|
try:
|
||
|
compile("", "stdin", "eval")
|
||
|
except SyntaxError:
|
||
|
print("SyntaxError")
|
||
|
compile("", "stdin", "exec")
|
||
|
|
||
|
# empty continued line
|
||
|
try:
|
||
|
compile("\\\n", "stdin", "single")
|
||
|
except SyntaxError:
|
||
|
print("SyntaxError")
|
||
|
try:
|
||
|
compile("\\\n", "stdin", "eval")
|
||
|
except SyntaxError:
|
||
|
print("SyntaxError")
|
||
|
compile("\\\n", "stdin", "exec")
|