#!/usr/bin/env ruby require "bundler/setup" require "turmali" require "readline" interpreter = Interpreter.new if file = ARGV.first interpreter.eval File.read(file) else puts "Turmali (#{Turmali::VERSION}) REPL, Type 'quit' or 'exit' to exit" loop do line = Readline::readline(">> ") exit if line == 'quit' exit if line == 'exit' Readline::HISTORY.push(line) value = interpreter.eval(line) puts "=> #{value.ruby_value.inspect}" end end