class Bpl::AST::CustomType
Public Instance Methods
expand()
click to toggle source
# File lib/bpl/ast/type.rb, line 34 def expand declaration && declaration.type.expand || self end
hilite()
click to toggle source
# File lib/bpl/ast/type.rb, line 54 def hilite "#{declaration ? @name.blue : @name.red} #{arguments.map{|a| yield a} * " "}".fmt end
show()
click to toggle source
def base
case declaration && declaration.type when CustomType; declaration.type.base when Type; declaration.type else self end
end def eql?(ty)
ty = ty.is_a?(CustomType) ? ty.base : ty case ty when CustomType; base.is_a?(CustomType) && base.name == ty.name else !base.is_a?(CustomType) && base.eql?(ty) end
end
# File lib/bpl/ast/type.rb, line 51 def show "#{@name} #{arguments.map{|a| yield a} * " "}".fmt end