[Python-checkins] CVS: python/dist/src/Grammar Grammar,1.40,1.41

Thomas Wouters python-dev@python.org
Thu, 24 Aug 2000 13:11:37 -0700


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

Modified Files:
	Grammar 
Log Message:

Support for three-token characters (**=, >>=, <<=) which was written by
Michael Hudson, and support in general for the augmented assignment syntax.
The graminit.c patch is large!



Index: Grammar
===================================================================
RCS file: /cvsroot/python/python/dist/src/Grammar/Grammar,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -r1.40 -r1.41
*** Grammar	2000/08/23 15:45:28	1.40
--- Grammar	2000/08/24 20:11:30	1.41
***************
*** 38,44 ****
  simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE
  #small_stmt: expr_stmt | print_stmt  | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | access_stmt | exec_stmt
! small_stmt: expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | exec_stmt | assert_stmt
! expr_stmt: testlist ('=' testlist)*
! # For assignments, additional restrictions enforced by the interpreter
  print_stmt: 'print' ( [ test (',' test)* [','] ] | '>>' test [ (',' test)+ [','] ] )
  del_stmt: 'del' exprlist
--- 38,45 ----
  simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE
  #small_stmt: expr_stmt | print_stmt  | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | access_stmt | exec_stmt
! 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)*)
! augassign: '+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' | '<<=' | '>>=' | '**='
! # For normal assignments, additional restrictions enforced by the interpreter
  print_stmt: 'print' ( [ test (',' test)* [','] ] | '>>' test [ (',' test)+ [','] ] )
  del_stmt: 'del' exprlist