Class: PersonifyLanguage::Logical

Inherits:
Treetop::Runtime::SyntaxNode
  • Object
show all
Defined in:
lib/personify/parser/personify_node_classes.rb

Instance Method Summary collapse

Instance Method Details

#eval(env) ⇒ Object



72
73
74
75
76
77
78
79
80
# File 'lib/personify/parser/personify_node_classes.rb', line 72

def eval(env)
  fe = first_expression.eval(env)
  ne = next_expression.eval(env)
  
  case operator.text_value
    when "&&" then fe && ne
    when "||" then fe || ne
  end
end