Class: EleetScript::ElseNode

Inherits:
Object
  • Object
show all
Includes:
Nextable, Returnable
Defined in:
lib/lang/nodes.rb,
lib/lang/interpreter.rb

Instance Method Summary collapse

Methods included from Nextable

#nexted, #nexted?, #reset_nexted

Methods included from Returnable

#reset_returned, #returned, #returned?

Instance Method Details

#eval(context) ⇒ Object



400
401
402
403
404
405
406
407
408
409
410
411
# File 'lib/lang/interpreter.rb', line 400

def eval(context)
  ret = body.eval(context)
  if body.returnable? and body.returned?
    body.reset_returned
    returned
  elsif body.nextable? && body.nexted?
    body.reset_nexted
    nexted
    return context.es_nil
  end
  ret
end