[Wisp-cvs] wisp/users/dig tran.py,1.115,1.116
Status: Alpha
Brought to you by:
digg
From: <di...@us...> - 2003-05-18 17:36:49
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv24666 Modified Files: tran.py Log Message: wrote Interpreter.do Index: tran.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/tran.py,v retrieving revision 1.115 retrieving revision 1.116 diff -u -d -r1.115 -r1.116 --- tran.py 18 May 2003 17:22:55 -0000 1.115 +++ tran.py 18 May 2003 17:36:44 -0000 1.116 @@ -305,6 +305,12 @@ else: raise 'Unknown meaning type in', `this.meaning[tok]` else: raise 'Unknown meaning format for', tok else: raise 'bad token', tok + def do (this, phrase): # Note that parsing is only partial + l = phrase.split() + for i in range(len(l)): + try: l[i] = Integer_Literal(long(l[i])) + except: pass + this.run(Macro_Cursor(l)) def run (this, toksrc, verbose = 0): if isinstance(toksrc, str): toksrc = Lexer(toksrc) this.toksrc = Preprocessor(toksrc) |