Class: Delorean::IfElse

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

Instance Method Summary collapse

Instance Method Details

#check(context) ⇒ Object



649
650
651
652
653
654
# File 'lib/delorean/nodes.rb', line 649

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

#rewrite(context) ⇒ Object



656
657
658
659
# File 'lib/delorean/nodes.rb', line 656

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