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