[Wisp-cvs] wisp/users/dig tran.py,1.33,1.34
Status: Alpha
Brought to you by:
digg
From: <di...@us...> - 2003-04-22 10:24:07
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv15923 Modified Files: tran.py Log Message: let Integer_Literal inherit from Summable Index: tran.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/tran.py,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- tran.py 22 Apr 2003 10:22:21 -0000 1.33 +++ tran.py 22 Apr 2003 10:24:03 -0000 1.34 @@ -32,7 +32,7 @@ class Stackable (object): def contained_registers (this): return () -class Integer_Literal (long, Stackable, Token): +class Integer_Literal (long, Stackable, Token, Summable): def __new__ (cls, i): return long.__new__(cls, i) def __add__ (this, that): @@ -41,6 +41,8 @@ return Integer_Literal(long(this) - long(that)) def __repr__ (this): return 'Integer_Literal(%i)' % long(this) + def get_scalar (this): + return long(this) class Symbol_Literal (str, Stackable): def __new__ (cls, s): return str.__new__(cls, s) |