Class: Crisp::Nodes::Operation

Inherits:
Base
  • Object
show all
Defined in:
lib/crisp/nodes/operation.rb

Overview

The operation node

Instance Method Summary collapse

Methods inherited from Base

#resolve_and_eval

Instance Method Details

#eval(env) ⇒ Object

get the function binded to the given function name and eval it (including arguments)



6
7
8
9
10
11
12
# File 'lib/crisp/nodes/operation.rb', line 6

def eval(env)
  if self.func_identifier.class.name == "Crisp::Nodes::Operation"
    self.func_identifier.eval(env).eval(env, raw_element_list)
  else
    env[self.func_identifier.text_value].eval(env, raw_element_list)
  end
end

#resolve(env) ⇒ Object

an operation resolves to itself



15
16
17
# File 'lib/crisp/nodes/operation.rb', line 15

def resolve(env)
  self
end