Method: C::Variable#recombine!

Defined in:
lib/csquare.rb

#recombine!(function, blueprint, type_symbol, return_type = nil) ⇒ Object

Replace some expression with the pattern from Blueprint.



669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
# File 'lib/csquare.rb', line 669

def recombine! function, blueprint, type_symbol, return_type=nil

  args_types = {}

  replace_vars = blueprint.vars(type_symbol)
  return_node =
  if replace_vars.has_key?(self.name)
    n = self.clone
    n.name = replace_vars[self.name]
    n
  else
    self
  end

  [return_node, self.return_typename(function, blueprint)]
end