<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -26,7 +26,8 @@
   To compile Ruby to a .pyc:
 
   &gt; bin/unholy test.rb
-  &gt; python test.rb.pyc
+  &gt; PYTHONPATH=python \
+               python test.rb.pyc
   
             ---
 </diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -4,13 +4,13 @@ class Pyasm
   }
 
   attr_accessor :argc, :nlocals, :stacksize, :flags, :consts, :bytecode,
-    :filename, :lineno, :name, :symbols, :stacknow, :varsyms, :jumps, :labels
-  def initialize(fname, name = &quot;&lt;module&gt;&quot;)
+    :filename, :lineno, :name, :symbols, :stacknow, :varsyms, :jumps, :labels, :lines
+  def initialize(fname, name = &quot;&lt;module&gt;&quot;, lineno = 0)
     @argc, @nlocals, @stacksize, @flags, @filename, @lineno, @name, @stack, @nopop = 
-      0, 0, 1, 0x40, fname, 1, name, [], 0
+      0, 0, 1, 0x40, fname, lineno, name, [], 0
     @consts = [-1, nil]
     @symbols = [:Kernel]
-    @bytecode, @varsyms, @labels, @jumps = [], [], {}, {}
+    @bytecode, @varsyms, @labels, @lines, @jumps = [], [], {}, [], {}
   end
 
   def add_const(obj)
@@ -43,6 +43,11 @@ class Pyasm
   end
 
   def pop_top; bc 0x01; dump_stack end
+  def binary_add
+    add = bc 0x17
+    @stack.pop
+    add
+  end
   def ret_val; bc 0x53 end
   def build_class; bc 0x59 end
   def store_name(name)
@@ -86,6 +91,7 @@ class Pyasm
     stack_push Object.new, bc(0x7c, n, 0x0)
   end
   def store_fast(n)
+    dump_stack
     bc 0x7d, n, 0x0
   end
   def call_func(arity)
@@ -95,6 +101,9 @@ class Pyasm
   def make_func(arity)
     bc 0x84, arity, 0x0
   end
+  def line n
+    @lines &lt;&lt; [n, @bytecode.flatten.length]
+  end
   def prep_send
     @nopop -= 1 if @nopop &gt; 0
   end
@@ -156,6 +165,9 @@ class Pyasm
   def newarray size
     build_list size
   end
+  def opt_plus
+    binary_add
+  end
   def putnil
     load_const(nil)
   end
@@ -227,7 +239,7 @@ class Pyasm
     bytes = @bytecode.slice! idx..-1
     bytes.shift unless receiver
 
-    asm = Pyasm.new(@filename, id.to_s)
+    asm = Pyasm.new(@filename, id.to_s, @lines.last[0])
     asm.load_iseq iseq
     if type == :class
       load_const(id.to_s)
@@ -268,9 +280,9 @@ class Pyasm
     iseq.last.each do |inst|
       case inst
       when Integer # line no
-        nil
+        line inst
       when Symbol
-        self.label inst
+        label inst
       when Array
         # p inst
         inst[0] = :message if inst[0] == :send
@@ -336,7 +348,14 @@ class Pyasm
     f &lt;&lt; @filename.to_pickle
     f &lt;&lt; @name.to_pickle
     f &lt;&lt; 1.to_plong
-    f &lt;&lt; &quot;&quot;.to_pickle
+
+    lnotab = &quot;&quot;
+    lastn, lastpos = @lines[0]
+    @lines[1..-1].each do |n, pos|
+      lnotab &lt;&lt; [pos - lastpos, n - lastn].pack(&quot;cc&quot;)
+      lastn, lastpos = n, pos
+    end
+    f &lt;&lt; lnotab.to_pickle
     f
   end
 </diff>
      <filename>lib/unholy/pyasm.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,6 @@
 def puts(*args):
   for x in args: print x
   if not args: print
+
+class BasicObject:
+  pass</diff>
      <filename>python/Kernel.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3b65c66935a74db4c6580b425afe0518aa59699b</id>
    </parent>
  </parents>
  <author>
    <name>_why</name>
    <email>why@whytheluckystiff.net</email>
  </author>
  <url>http://github.com/devyn/unholy/commit/eab2a68059233e78ff25e8271e85988e6015fa61</url>
  <id>eab2a68059233e78ff25e8271e85988e6015fa61</id>
  <committed-date>2008-05-05T20:17:26-07:00</committed-date>
  <authored-date>2008-05-05T20:17:26-07:00</authored-date>
  <message> * lib/unholy/pyasm.rb: re-merge the line numbers fix.</message>
  <tree>5235bdc07e381c9797ee35ac724d27ee8b50f62d</tree>
  <committer>
    <name>_why</name>
    <email>why@whytheluckystiff.net</email>
  </committer>
</commit>
