Class: Delorean::IfElse

Inherits:
SNode
  • Object
show all
Defined in:
lib/delorean/nodes.rb

Instance Method Summary collapse

Instance Method Details

#check(context) ⇒ Object



618
619
620
621
622
623
# File 'lib/delorean/nodes.rb', line 618

def check(context, *)
  vc = v.check(context)
  e1c = e1.check(context)
  e2c = e2.check(context)
  vc + e1c + e2c
end

#rewrite(context) ⇒ Object



625
626
627
628
# File 'lib/delorean/nodes.rb', line 625

def rewrite(context)
  "(#{v.rewrite(context)}) ? (#{e1.rewrite(context)}) :
   (#{e2.rewrite(context)})"
end