[Wisp-cvs] wisp/users/dig tran.py,1.13,1.14
Status: Alpha
Brought to you by:
digg
From: <di...@us...> - 2003-04-16 11:58:51
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv29009 Modified Files: tran.py Log Message: cleaned up Lexer.__init__ interface Index: tran.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/tran.py,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- tran.py 16 Apr 2003 08:04:12 -0000 1.13 +++ tran.py 16 Apr 2003 11:58:47 -0000 1.14 @@ -19,8 +19,8 @@ import sys class Lexer (shlex): - def __init__ (this, instream = None, infile = None): - shlex.__init__(this, instream = instream, infile = infile) + def __init__ (this, filename): + shlex.__init__(this, instream = open(filename, 'r'), infile = filename) this.commenters = '\\' this.quotes = '"' this.wordchars += '!#$%*+,-./:;<=>?@' @@ -303,7 +303,7 @@ opts, args = getopt(sys.argv[1:], 'o:', ['output=']) if len(args) != 1: raise 'Invalid argument count -- must be 1', args - lex = Lexer(instream = open(args[0], 'r'), infile = args[0]) + lex = Lexer(args[0]) output_name = 'a.out' for opt, arg in opts: if opt in ('-o', '--output'): output_name = arg |