Class: Delorean::IfElse

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

Instance Method Summary collapse

Instance Method Details

#check(context) ⇒ Object



405
406
407
408
409
# File 'lib/delorean/nodes.rb', line 405

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

#rewrite(context) ⇒ Object



411
412
413
414
# File 'lib/delorean/nodes.rb', line 411

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