[Python-checkins] CVS: python/dist/src/Grammar Grammar,1.35,1.36

Skip Montanaro python-dev@python.org
Sat, 12 Aug 2000 11:09:53 -0700


Update of /cvsroot/python/python/dist/src/Grammar
In directory slayer.i.sourceforge.net:/tmp/cvs-serv9983/Grammar

Modified Files:
	Grammar 
Log Message:
list comprehensions.  see

    http://sourceforge.net/patch/?func=detailpatch&patch_id=100654&group_id=5470

for details.



Index: Grammar
===================================================================
RCS file: /cvsroot/python/python/dist/src/Grammar/Grammar,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -r1.35 -r1.36
*** Grammar	2000/03/28 23:49:00	1.35
--- Grammar	2000/08/12 18:09:51	1.36
***************
*** 75,79 ****
  factor: ('+'|'-'|'~') factor | power
  power: atom trailer* ('**' factor)*
! atom: '(' [testlist] ')' | '[' [testlist] ']' | '{' [dictmaker] '}' | '`' testlist '`' | NAME | NUMBER | STRING+
  lambdef: 'lambda' [varargslist] ':' test
  trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME
--- 75,80 ----
  factor: ('+'|'-'|'~') factor | power
  power: atom trailer* ('**' factor)*
! atom: '(' [testlist] ')' | '[' [listmaker] ']' | '{' [dictmaker] '}' | '`' testlist '`' | NAME | NUMBER | STRING+
! listmaker: test ( list_iter | (',' test)* [','] )
  lambdef: 'lambda' [varargslist] ':' test
  trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME
***************
*** 89,90 ****
--- 90,95 ----
  arglist: (argument ',')* (argument [',']| '*' test [',' '**' test] | '**' test)
  argument: [test '='] test	# Really [keyword '='] test
+ 
+ list_iter: list_for | list_if
+ list_for: 'for' exprlist 'in' testlist [list_iter]
+ list_if: 'if' test [list_iter]