Class: Delorean::HashExpr

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

Instance Method Summary collapse

Instance Method Details

#check(context) ⇒ Object



595
596
597
# File 'lib/delorean/nodes.rb', line 595

def check(context, *)
  defined?(args) ? args.check(context) : []
end

#rewrite(context) ⇒ Object



599
600
601
602
603
604
# File 'lib/delorean/nodes.rb', line 599

def rewrite(context)
  return '{}' unless defined?(args)

  var = "_h#{context.hcount}"
  "(#{var}={}; " + args.rewrite(context, var) + "; #{var})"
end