Module: Trxl::Definition1

Defined in:
lib/trxl/trxl_grammar.rb

Instance Method Summary collapse

Instance Method Details

#eval(env = Environment.new) ⇒ Object



615
616
617
# File 'lib/trxl/trxl_grammar.rb', line 615

def eval(env = Environment.new)
  env[variable.name] = expression.eval(env)
end

#to_s(env = Environment.new) ⇒ Object



619
620
621
# File 'lib/trxl/trxl_grammar.rb', line 619

def to_s(env = Environment.new)
  "#{variable.name} = #{expression.eval(env)}"
end