Update of /cvsroot/wisp/wisp/users/dig
In directory sc8-pr-cvs1:/tmp/cvs-serv13944
Modified Files:
interpreter.py
Log Message:
changed Register.__new__'s interface to take all items in a single argument
Index: interpreter.py
===================================================================
RCS file: /cvsroot/wisp/wisp/users/dig/interpreter.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- interpreter.py 17 May 2003 11:35:29 -0000 1.1
+++ interpreter.py 17 May 2003 11:46:36 -0000 1.2
@@ -139,17 +139,17 @@
else: return Lexer.get_token(this)
class Register (tuple, Stackable):
- def __new__ (cls, *args):
- return tuple.__new__(cls, args)
+ def __new__ (cls, items):
+ return tuple.__new__(cls, items)
def parent (this):
- if len(this): return apply(Register, this[:-1])
+ if len(this): return Register(this[:-1])
else: return None
def next (this):
l = list(this)
l[-1] += 1
- return apply(Register, l)
+ return Register(l)
def child (this, index = 0):
- return apply(Register, this + (index,))
+ return Register(this + (index,))
def __repr__ (this):
return 'Register' + tuple.__repr__(this)
def __str__ (this):
@@ -203,7 +203,7 @@
except StopIteration: pass
except StopIteration: pass
-Generic_Register = Register()
+Generic_Register = Register([])
MA_PREFIX = 1
@@ -248,7 +248,7 @@
this.meaning[s] = 'builtin', this.make_section_switcher(s), 0
this.current = this.sections[sections[0]]
this.recordee = None
- this.regpaths = [Register(0)] # for generating new registers
+ this.regpaths = [Register([0])] # for generating new registers
this.hanging = {}
this.regstack = []
this.state = this.outer_state
|