[Python-checkins] python/dist/src/Grammar Grammar, 1.47.2.3, 1.47.2.4

jhylton@users.sourceforge.net jhylton at users.sourceforge.net
Sun Oct 16 07:24:31 CEST 2005


Update of /cvsroot/python/python/dist/src/Grammar
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27718/Grammar

Modified Files:
      Tag: ast-branch
	Grammar 
Log Message:
Merge head to branch (for the last time)


Index: Grammar
===================================================================
RCS file: /cvsroot/python/python/dist/src/Grammar/Grammar,v
retrieving revision 1.47.2.3
retrieving revision 1.47.2.4
diff -u -d -r1.47.2.3 -r1.47.2.4
--- Grammar	15 Apr 2005 02:18:25 -0000	1.47.2.3
+++ Grammar	16 Oct 2005 05:23:58 -0000	1.47.2.4
@@ -39,7 +39,7 @@
 stmt: simple_stmt | compound_stmt
 simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE
 small_stmt: expr_stmt | print_stmt  | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | exec_stmt | assert_stmt
-expr_stmt: testlist (augassign testlist | ('=' testlist)*)
+expr_stmt: testlist (augassign (yield_expr|testlist) | ('=' (yield_expr|testlist))*)
 augassign: '+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' | '<<=' | '>>=' | '**=' | '//='
 # For normal assignments, additional restrictions enforced by the interpreter
 print_stmt: 'print' ( [ test (',' test)* [','] ] | '>>' test [ (',' test)+ [','] ] )
@@ -49,7 +49,7 @@
 break_stmt: 'break'
 continue_stmt: 'continue'
 return_stmt: 'return' [testlist]
-yield_stmt: 'yield' testlist
+yield_stmt: yield_expr
 raise_stmt: 'raise' [test [',' test [',' test]]]
 import_stmt: import_name | import_from
 import_name: 'import' dotted_as_names
@@ -86,7 +86,7 @@
 term: factor (('*'|'/'|'%'|'//') factor)*
 factor: ('+'|'-'|'~') factor | power
 power: atom trailer* ['**' factor]
-atom: '(' [testlist_gexp] ')' | '[' [listmaker] ']' | '{' [dictmaker] '}' | '`' testlist1 '`' | NAME | NUMBER | STRING+
+atom: '(' [yield_expr|testlist_gexp] ')' | '[' [listmaker] ']' | '{' [dictmaker] '}' | '`' testlist1 '`' | NAME | NUMBER | STRING+
 listmaker: test ( list_for | (',' test)* [','] )
 testlist_gexp: test ( gen_for | (',' test)* [','] )
 lambdef: 'lambda' [varargslist] ':' test
@@ -116,3 +116,6 @@
 
 # not used in grammar, but may appear in "node" passed from Parser to Compiler
 encoding_decl: NAME
+
+yield_expr: 'yield' [testlist]
+



More information about the Python-checkins mailing list