lib/nydp.rb in nydp-0.1.12 vs lib/nydp.rb in nydp-0.1.13
- old
+ new
@@ -31,12 +31,13 @@
function.invoke vm, args
vm.thread
end
- def self.eval_src ns, src_txt
- Nydp::Runner.new(VM.new, ns, Nydp::StringReader.new(src_txt)).run
- end
+ def self.reader txt ; Nydp::StringReader.new txt ; end
+ def self.eval_src ns, src_txt ; eval_with Nydp::Runner, ns, src_txt ; end
+ def self.eval_src! ns, src_txt ; eval_with Nydp::ExplodeRunner, ns, src_txt ; end
+ def self.eval_with runner, ns, src_txt ; runner.new(VM.new, ns, reader(src_txt)).run ; end
def self.repl
puts "welcome to nydp"
puts "^D to exit"
reader = Nydp::ReadlineReader.new $stdin, "nydp > "