Module: RubyLisp::Parser

Defined in:
lib/rubylisp/parser.rb

Class Method Summary collapse

Class Method Details

.eval_ast(input, env) ⇒ Object



14
15
16
# File 'lib/rubylisp/parser.rb', line 14

def eval_ast input, env
  Evaluator.eval_ast input, env
end

.parse(input, env = Environment.new.stdlib) ⇒ Object



22
23
24
25
26
# File 'lib/rubylisp/parser.rb', line 22

def parse input, env = Environment.new.stdlib
  ast = read input
  result = eval_ast ast, env
  print result
end


18
19
20
# File 'lib/rubylisp/parser.rb', line 18

def print input
  Printer.pr_str input
end

.read(input) ⇒ Object



10
11
12
# File 'lib/rubylisp/parser.rb', line 10

def read input
  Reader.read_str input
end