Class: Delorean::IfElse

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

Instance Method Summary collapse

Instance Method Details

#check(context) ⇒ Object



660
661
662
663
664
665
# File 'lib/delorean/nodes.rb', line 660

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

#rewrite(context) ⇒ Object



667
668
669
670
# File 'lib/delorean/nodes.rb', line 667

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