Class: C::Function

Inherits:
Object
  • Object
show all
Defined in:
lib/csquare.rb

Instance Method Summary collapse

Instance Method Details

#replace_types!(h) ⇒ Object



736
737
738
739
740
741
742
743
744
745
746
# File 'lib/csquare.rb', line 736

def replace_types! h
  # Replace return typename
  type.name = h[type.name] if (type.CustomType? || type.Struct?) && h.has_key?(type.name)

  # Replace params' typenames
  params.each do |param|
    if h.has_key?(param.type.underlying_typename)
      param.replace_with C::Parameter.parse(param.to_s.gsub(param.type.underlying_typename, h[param.type.underlying_typename]))
    end
  end
end

#return_typename(function, blueprint) ⇒ Object



732
733
734
# File 'lib/csquare.rb', line 732

def return_typename function, blueprint
  self.type.to_s
end