2015-07-24 16:05:56 +01:00
|
|
|
# parser tests
|
|
|
|
|
2015-07-24 22:37:26 +01:00
|
|
|
try:
|
|
|
|
compile
|
|
|
|
except NameError:
|
|
|
|
print("SKIP")
|
2017-06-10 18:03:01 +01:00
|
|
|
raise SystemExit
|
2015-07-24 22:37:26 +01:00
|
|
|
|
2015-07-24 16:05:56 +01:00
|
|
|
# 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")
|