[Python-checkins] python/nondist/sandbox/ast python.asdl,1.11,1.12

jhylton@sourceforge.net jhylton@sourceforge.net
Mon, 15 Apr 2002 20:20:47 -0700


Update of /cvsroot/python/python/nondist/sandbox/ast
In directory usw-pr-cvs1:/tmp/cvs-serv17187

Modified Files:
	python.asdl 
Log Message:
Instead of extra Lvalue production, have separate constructors for the
assign type.  This makes sense because the code generate for an
expression as the target of an assignment is quite different than an
expression elsewhere.

Remove LtGt (Less than, Greater than) as that's just another way to
spell NotEq.


Index: python.asdl
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/ast/python.asdl,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** python.asdl	14 Apr 2002 10:10:02 -0000	1.11
--- python.asdl	16 Apr 2002 03:20:45 -0000	1.12
***************
*** 53,68 ****
  			 expr? starargs, expr? kwargs)
  	     | Repr(expr value)
- 	     | Lvalue(assign lvalue)
  	     | Num(string n) -- string representation of a number
  	     | Str(string s) -- need to specify raw, unicode, etc?
  	     -- other literals? bools?
! 
! 	-- the subset of expressions that are valid as the target of
! 	-- assignments. 
! 	assign = Attribute(expr value, identifier attr)
  	     | Subscript(expr value, slice slice)
  	     | Name(identifier id)
  	     | List(expr* elts) | Tuple(expr *elts)
  
          slice = Ellipsis | Slice(expr? lower, expr? upper) 
  	      -- maybe Slice and ExtSlice should be merged...
--- 53,71 ----
  			 expr? starargs, expr? kwargs)
  	     | Repr(expr value)
  	     | Num(string n) -- string representation of a number
  	     | Str(string s) -- need to specify raw, unicode, etc?
  	     -- other literals? bools?
! 	     | Attribute(expr value, identifier attr)
  	     | Subscript(expr value, slice slice)
  	     | Name(identifier id)
  	     | List(expr* elts) | Tuple(expr *elts)
  
+ 	-- the subset of expressions that are valid as the target of
+ 	-- assignments. 
+ 	assign = AssignAttribute(expr value, identifier attr)
+ 	     | AssignSubscript(expr value, slice slice)
+ 	     | AssignName(identifier id)
+ 	     | AssignList(expr* elts) | AssignTuple(expr *elts)
+ 
          slice = Ellipsis | Slice(expr? lower, expr? upper) 
  	      -- maybe Slice and ExtSlice should be merged...
***************
*** 76,81 ****
  	unaryop = Invert | Not | UAdd | USub
  
! 	cmpop = Eq | NotEq | Lt | LtE | Gt | GtE | LtGt 
! 	      | Is | IsNot | In | NotIn
  
  	listcomp = (expr target, expr iter, expr* ifs)
--- 79,83 ----
  	unaryop = Invert | Not | UAdd | USub
  
! 	cmpop = Eq | NotEq | Lt | LtE | Gt | GtE | Is | IsNot | In | NotIn
  
  	listcomp = (expr target, expr iter, expr* ifs)