class SFRP::Poly::TConst

Attributes

str[R]

Public Class Methods

new( str, paramc, vconst_strs = nil, static = false, native_str = nil ) click to toggle source
# File lib/sfrp/poly/elements.rb, line 114
def initialize(
  str, paramc, vconst_strs = nil, static = false, native_str = nil
)
  @str = str
  @paramc = paramc
  @vconst_strs = vconst_strs
  @static = static
  @native_str = native_str
end

Public Instance Methods

clone() click to toggle source
# File lib/sfrp/poly/elements.rb, line 128
def clone
  TConst.new(@str, @paramc, @vconst_strs, @static, @native_str)
end
to_mono(monofier) click to toggle source
# File lib/sfrp/poly/elements.rb, line 132
def to_mono(monofier)
  raise UndeterminableTypeError.new(@str, @typing) unless @typing.mono?
  type_str = monofier.use_type(@typing)
  return M.type(type_str, nil, @static, @native_str) unless @vconst_strs
  vconst_strs = @vconst_strs.map { |s| monofier.use_vconst(s, @typing) }
  M.type(type_str, vconst_strs, @static, @native_str)
end
typing() click to toggle source
# File lib/sfrp/poly/elements.rb, line 124
def typing
  @typing ||= Typing.new(@str, Array.new(@paramc) { Typing.new })
end