GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: a ruby-to-pyc compiler
Clone URL: git://github.com/why/unholy.git
 * README: use PYTHONPATH var when running the pyc.
 * lib/unholy/pyasm.rb: working on addition.
why (author)
Mon May 05 11:36:37 -0700 2008
commit  82cce7287f80b8a7309d399615ec48a81bb03480
tree    86322b03ddd2be27e1bbdf910059c0237f7ebd0c
parent  7ff70885df568be45997640f65415915231a46a2
0
...
26
27
28
29
 
 
30
31
32
...
26
27
28
 
29
30
31
32
33
0
@@ -26,7 +26,8 @@
0
   To compile Ruby to a .pyc:
0
 
0
   > bin/unholy test.rb
0
- > python test.rb.pyc
0
+ > PYTHONPATH=python \
0
+ python test.rb.pyc
0
   
0
             ---
0
 
...
43
44
45
 
 
 
 
 
46
47
48
...
154
155
156
 
 
 
157
158
159
...
280
281
282
283
 
284
285
286
...
43
44
45
46
47
48
49
50
51
52
53
...
159
160
161
162
163
164
165
166
167
...
288
289
290
 
291
292
293
294
0
@@ -43,6 +43,11 @@ class Pyasm
0
   end
0
 
0
   def pop_top; bc 0x01; dump_stack end
0
+ def binary_add
0
+ add = bc 0x17
0
+ @stack.pop
0
+ add
0
+ end
0
   def ret_val; bc 0x53 end
0
   def build_class; bc 0x59 end
0
   def store_name(name)
0
@@ -154,6 +159,9 @@ class Pyasm
0
   def newarray size
0
     build_list size
0
   end
0
+ def opt_plus
0
+ binary_add
0
+ end
0
   def putnil
0
     load_const(nil)
0
   end
0
@@ -280,7 +288,7 @@ class Pyasm
0
     begin
0
       iseq = VM::InstructionSequence.compile(src)
0
       load_iseq iseq
0
- rescue NameError
0
+ rescue NameError => e
0
       puts "*** Are you sure you're running Ruby 1.9?"
0
       throw e
0
     end

Comments

    No one has commented yet.