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
|
2001-01-25 16:12:27 -04:00
|
|
|
lambdef
|
1996-12-10 19:20:09 -04:00
|
|
|
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
|
1996-12-10 19:20:09 -04:00
|
|
|
del_stmt
|
|
|
|
pass_stmt
|
|
|
|
flow_stmt
|
|
|
|
break_stmt
|
|
|
|
continue_stmt
|
2001-02-01 18:48:12 -04:00
|
|
|
continue + try/except ok
|
|
|
|
continue + try/finally ok
|
2001-09-26 09:43:39 -03:00
|
|
|
testing continue and break in try/except in loop
|
1996-12-10 19:20:09 -04:00
|
|
|
return_stmt
|
|
|
|
raise_stmt
|
2004-08-31 07:07:13 -03:00
|
|
|
import_name
|
|
|
|
import_from
|
1996-12-10 19:20:09 -04:00
|
|
|
global_stmt
|
|
|
|
exec_stmt
|
2001-02-19 11:54:52 -04:00
|
|
|
assert_stmt
|
1996-12-10 19:20:09 -04:00
|
|
|
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')]
|
2003-05-21 14:34:50 -03:00
|
|
|
[[1], [1, 1], [1, 2, 4], [1, 3, 9, 27], [1, 4, 16, 64, 256]]
|
2002-04-03 18:41:51 -04:00
|
|
|
[False, False, False]
|
2001-03-19 16:42:11 -04:00
|
|
|
[[1, 2], [3, 4], [5, 6]]
|
2000-08-12 15:09:51 -03:00
|
|
|
[('Boeing', 'Airliner'), ('Boeing', 'Engine'), ('Ford', 'Engine'), ('Macdonalds', 'Cheeseburger')]
|