Class: Delorean::HashExpr

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

Instance Method Summary collapse

Instance Method Details

#check(context) ⇒ Object



535
536
537
# File 'lib/delorean/nodes.rb', line 535

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

#rewrite(context) ⇒ Object



539
540
541
542
543
# File 'lib/delorean/nodes.rb', line 539

def rewrite(context)
  return "{}" unless defined?(args)
  var = "_h#{context.hcount}"
  "(#{var}={}; " + args.rewrite(context, var) + "; #{var})"
end