Permalink
Browse files

Add extra functions Lupin.sexp() and Lupin.bytecode() for inspection …

…from IRB.
  • Loading branch information...
1 parent 4fc7642 commit f9d3a6716ef03dbb7e6a4de679cc085ce3c7449f @Twisol committed Feb 22, 2011
Showing with 9 additions and 0 deletions.
  1. +9 −0 lib/lupin.rb
View
@@ -9,4 +9,13 @@ def self.eval (state, str)
ast = Lupin::Parser.parse(str, :root => :expression)
state.compile(ast).call
end
+
+ def self.sexp (state, str)
+ Lupin::Parser.parse(str, :root => :expression).sexp
+ end
+
+ def self.bytecode (state, str)
+ ast = Lupin::Parser.parse(str, :root => :expression)
+ state.compile(ast).decode
+ end
end

0 comments on commit f9d3a67

Please sign in to comment.