~ubuntu-branches/ubuntu/lucid/python2.6/lucid

« back to all changes in this revision

Viewing changes to Lib/lib2to3/Grammar.txt

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-03-11 13:30:19 UTC
  • mto: (10.1.13 sid)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100311133019-sblbooa3uqrkoe70
Tags: upstream-2.6.5~rc2
ImportĀ upstreamĀ versionĀ 2.6.5~rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE
54
54
small_stmt: (expr_stmt | print_stmt  | del_stmt | pass_stmt | flow_stmt |
55
55
             import_stmt | global_stmt | exec_stmt | assert_stmt)
56
 
expr_stmt: testlist (augassign (yield_expr|testlist) |
57
 
                     ('=' (yield_expr|testlist))*)
 
56
expr_stmt: testlist_star_expr (augassign (yield_expr|testlist) |
 
57
                     ('=' (yield_expr|testlist_star_expr))*)
 
58
testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [',']
58
59
augassign: ('+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' |
59
60
            '<<=' | '>>=' | '**=' | '//=')
60
61
# For normal assignments, additional restrictions enforced by the interpreter
90
91
            ['else' ':' suite]
91
92
            ['finally' ':' suite] |
92
93
           'finally' ':' suite))
93
 
with_stmt: 'with' test [ with_var ] ':' suite
 
94
with_stmt: 'with' with_item (',' with_item)*  ':' suite
 
95
with_item: test ['as' expr]
94
96
with_var: 'as' expr
95
97
# NB compile.c makes sure that the default except clause is last
96
98
except_clause: 'except' [test [(',' | 'as') test]]
111
113
not_test: 'not' not_test | comparison
112
114
comparison: expr (comp_op expr)*
113
115
comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not'
 
116
star_expr: '*' expr
114
117
expr: xor_expr ('|' xor_expr)*
115
118
xor_expr: and_expr ('^' and_expr)*
116
119
and_expr: shift_expr ('&' shift_expr)*
124
127
       '{' [dictsetmaker] '}' |
125
128
       '`' testlist1 '`' |
126
129
       NAME | NUMBER | STRING+ | '.' '.' '.')
127
 
listmaker: test ( comp_for | (',' test)* [','] )
128
 
testlist_gexp: test ( comp_for | (',' test)* [','] )
 
130
listmaker: (test|star_expr) ( comp_for | (',' (test|star_expr))* [','] )
 
131
testlist_gexp: test ( comp_for | (',' (test|star_expr))* [','] )
129
132
lambdef: 'lambda' [varargslist] ':' test
130
133
trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME
131
134
subscriptlist: subscript (',' subscript)* [',']
132
135
subscript: test | [test] ':' [test] [sliceop]
133
136
sliceop: ':' [test]
134
 
exprlist: expr (',' expr)* [',']
 
137
exprlist: (expr|star_expr) (',' (expr|star_expr))* [',']
135
138
testlist: test (',' test)* [',']
136
139
dictsetmaker: ( (test ':' test (comp_for | (',' test ':' test)* [','])) |
137
140
                (test (comp_for | (',' test)* [','])) )