[Python-checkins] python/dist/src/Grammar Grammar,1.46,1.47
gvanrossum@users.sourceforge.net
gvanrossum@users.sourceforge.net
Fri, 24 May 2002 08:47:08 -0700
Update of /cvsroot/python/python/dist/src/Grammar
In directory usw-pr-cvs1:/tmp/cvs-serv941/Grammar
Modified Files:
Grammar
Log Message:
Disambiguate the grammar for backtick.
The old syntax suggested that a trailing comma was OK inside backticks,
but in fact (due to ideosyncrasies of pgen) it was not. Fix the grammar
to avoid the ambiguity. Fred: you may want to update the refman.
Index: Grammar
===================================================================
RCS file: /cvsroot/python/python/dist/src/Grammar/Grammar,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** Grammar 23 May 2002 20:05:40 -0000 1.46
--- Grammar 24 May 2002 15:47:06 -0000 1.47
***************
*** 81,85 ****
factor: ('+'|'-'|'~') factor | power
power: atom trailer* ['**' factor]
! atom: '(' [testlist] ')' | '[' [listmaker] ']' | '{' [dictmaker] '}' | '`' testlist '`' | NAME | NUMBER | STRING+
listmaker: test ( list_for | (',' test)* [','] )
lambdef: 'lambda' [varargslist] ':' test
--- 81,85 ----
factor: ('+'|'-'|'~') factor | power
power: atom trailer* ['**' factor]
! atom: '(' [testlist] ')' | '[' [listmaker] ']' | '{' [dictmaker] '}' | '`' testlist1 '`' | NAME | NUMBER | STRING+
listmaker: test ( list_for | (',' test)* [','] )
lambdef: 'lambda' [varargslist] ':' test
***************
*** 101,102 ****
--- 101,104 ----
list_for: 'for' exprlist 'in' testlist_safe [list_iter]
list_if: 'if' test [list_iter]
+
+ testlist1: test (',' test)*