[Wisp-cvs] wisp/users/dig tran.py,1.132,1.133
Status: Alpha
                
                Brought to you by:
                
                    digg
                    
                
            | 
     
      
      
      From: <di...@us...> - 2003-05-22 19:12:57
      
     
   | 
Update of /cvsroot/wisp/wisp/users/dig
In directory sc8-pr-cvs1:/tmp/cvs-serv1357
Modified Files:
	tran.py 
Log Message:
minor cleanup
Index: tran.py
===================================================================
RCS file: /cvsroot/wisp/wisp/users/dig/tran.py,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -d -r1.132 -r1.133
--- tran.py	22 May 2003 18:59:52 -0000	1.132
+++ tran.py	22 May 2003 19:12:54 -0000	1.133
@@ -261,16 +261,16 @@
     def switch_to_section (this, name):
         this.current = this.sections[name]
 
-    def __init__ (this, byte_order):
+    def __init__ (this, arg):
         this.meaning = Interpreter.universal_meaning.copy()
         this.current = None
         this.sections = {}
         # if first argument is a linkie, all output goes to that linkie
-        if isinstance(byte_order, Linkie):
-            this.current = byte_order
-            this.byte_order = this.current.get_byte_order()
-        else:
-            this.byte_order = byte_order
+        if isinstance(arg, Linkie):
+            this.byte_order = arg.get_byte_order()
+            this.add_section('.all', arg)
+        else: # otherwise, it's treated as byte order indicator
+            this.byte_order = arg
         this.register_names = {}
         reg = Register([], names = this.register_names)
         this.meaning['reg'] = reg
@@ -374,7 +374,7 @@
 
     byte_order = target[0]
     sections = target[1:]
-    interp = Interpreter(byte_order = byte_order)
+    interp = Interpreter(byte_order)
     for s in sections:
         interp.add_section(s)
     for i in include: interp.run(i + '.tran')
 |