[Wisp-cvs] wisp/users/dig tran.py,1.68,1.69
Status: Alpha
Brought to you by:
digg
From: <di...@us...> - 2003-05-15 05:57:33
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv9155 Modified Files: tran.py Log Message: implemented Token_Source interface for Macro_Cursor Index: tran.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/tran.py,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -r1.68 -r1.69 --- tran.py 15 May 2003 05:39:50 -0000 1.68 +++ tran.py 15 May 2003 05:57:30 -0000 1.69 @@ -123,11 +123,11 @@ def push_file (this, filename): this.push_source(open(filename, 'r'), filename) -class Macro_Cursor (object): +class Macro_Cursor (Token_Source): def __init__ (this, sequence): this.sequence = sequence this.current = 0 - def get_next (this): + def get_token (this): if this.current >= len(this.sequence): return None datum = this.sequence[this.current] this.current += 1 @@ -142,7 +142,7 @@ def get_token (this): tok = None while this.macros and tok == None: - tok = this.macros[-1].get_next() + tok = this.macros[-1].get_token() if tok == None: this.macros.pop() if tok <> None: return tok else: return Lexer.get_token(this) |