summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/parser.py
blob: e12f02599ea68aebb1a2b9616bc618524673df4f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 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")