Chervil is a toy Lisp interpreter written in Ruby
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

chervil 260B

123456789101112
  1. #!/usr/bin/env ruby
  2. require "chervil"
  3. require "readline"
  4. env = Chervil::Env.new
  5. while line = Readline.readline("> ", true)
  6. lexer = Chervil::Lexer.new(line)
  7. tree = Chervil::Parser.new(lexer).parse
  8. puts Chervil::Interpreter.new(tree, env).interpret
  9. end