[Wisp-cvs] wisp/users/dig tran.py,1.14,1.15
Status: Alpha
Brought to you by:
digg
From: <di...@us...> - 2003-04-16 12:04:24
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv31469 Modified Files: tran.py Log Message: wrote Lexer.push Index: tran.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/tran.py,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- tran.py 16 Apr 2003 11:58:47 -0000 1.14 +++ tran.py 16 Apr 2003 12:04:20 -0000 1.15 @@ -33,6 +33,8 @@ try: tok = string.atol(tok, 10) except: pass return tok + def push (this, filename): + this.push_source(open(filename, 'r'), filename) class Register (tuple): def __new__ (cls, *args): @@ -216,7 +218,7 @@ Regstack.append(m[1]) elif mtype == 'include': fn = get_token() + '.tran' - lex.push_source(open(fn), fn) + lex.push(fn) else: raise 'Unknown meaning type in', `Meaning[tok]` def state_record (tok): global State, current_recordee |