1996-12-10 19:20:09 -04:00
|
|
|
test_grammar
|
|
|
|
1. Parser
|
|
|
|
1.1 Tokens
|
|
|
|
1.1.1 Backslashes
|
|
|
|
1.1.2 Numeric literals
|
|
|
|
1.1.2.1 Plain integers
|
|
|
|
1.1.2.2 Long integers
|
|
|
|
1.1.2.3 Floating point
|
|
|
|
1.1.3 String literals
|
|
|
|
1.2 Grammar
|
|
|
|
single_input
|
|
|
|
file_input
|
|
|
|
expr_input
|
|
|
|
eval_input
|
|
|
|
funcdef
|
|
|
|
simple_stmt
|
|
|
|
expr_stmt
|
|
|
|
print_stmt
|
|
|
|
1 2 3
|
|
|
|
1 2 3
|
|
|
|
1 1 1
|
2000-08-21 12:46:50 -03:00
|
|
|
extended print_stmt
|
|
|
|
1 2 3
|
|
|
|
1 2 3
|
|
|
|
1 1 1
|
2000-08-29 01:57:10 -03:00
|
|
|
hello world
|
2001-01-25 13:03:37 -04:00
|
|
|
SyntaxError expected for "print ,"
|
|
|
|
SyntaxError expected for "print >> x,"
|
1996-12-10 19:20:09 -04:00
|
|
|
del_stmt
|
|
|
|
pass_stmt
|
|
|
|
flow_stmt
|
|
|
|
break_stmt
|
|
|
|
continue_stmt
|
|
|
|
return_stmt
|
|
|
|
raise_stmt
|
|
|
|
import_stmt
|
|
|
|
global_stmt
|
|
|
|
exec_stmt
|
|
|
|
if_stmt
|
|
|
|
while_stmt
|
|
|
|
for_stmt
|
|
|
|
try_stmt
|
|
|
|
suite
|
|
|
|
test
|
|
|
|
comparison
|
|
|
|
binary mask ops
|
|
|
|
shift ops
|
|
|
|
additive ops
|
|
|
|
multiplicative ops
|
|
|
|
unary ops
|
|
|
|
selectors
|
2000-03-28 19:51:17 -04:00
|
|
|
|
1996-12-10 19:20:09 -04:00
|
|
|
atoms
|
|
|
|
classdef
|
2000-08-12 15:09:51 -03:00
|
|
|
['Apple', 'Banana', 'Coco nut']
|
|
|
|
[3, 6, 9, 12, 15]
|
|
|
|
[3, 4, 5]
|
|
|
|
[(1, 'Apple'), (1, 'Banana'), (1, 'Coconut'), (2, 'Apple'), (2, 'Banana'), (2, 'Coconut'), (3, 'Apple'), (3, 'Banana'), (3, 'Coconut'), (4, 'Apple'), (4, 'Banana'), (4, 'Coconut'), (5, 'Apple'), (5, 'Banana'), (5, 'Coconut')]
|
|
|
|
[(1, 'Banana'), (1, 'Coconut'), (2, 'Banana'), (2, 'Coconut'), (3, 'Banana'), (3, 'Coconut'), (4, 'Banana'), (4, 'Coconut'), (5, 'Banana'), (5, 'Coconut')]
|
2001-01-22 21:51:40 -04:00
|
|
|
[0, 0, 0]
|
2001-01-25 13:03:37 -04:00
|
|
|
SyntaxError expected for "[i, s for i in nums for s in strs]"
|
|
|
|
SyntaxError expected for "[x if y]"
|
2000-08-12 15:09:51 -03:00
|
|
|
[('Boeing', 'Airliner'), ('Boeing', 'Engine'), ('Ford', 'Engine'), ('Macdonalds', 'Cheeseburger')]
|