func (v *Variable) String() string { result := "(" + util.Blue("Variable") + ": " if v.Mutable { result += util.Green("[mutable] ") } for _, attr := range v.Attrs { result += attr.String() + " " } return result + v.Name + util.Magenta(" <"+v.MangledName(MANGLE_ARK_UNSTABLE)+"> ") + util.Green(v.Type.TypeName()) + ")" }
func (v *TraitType) String() string { result := "(" + util.Blue("TraitType") + ": " for _, attr := range v.attrs { result += attr.String() + " " } result += v.Name + "\n" for _, decl := range v.Functions { result += "\t" + decl.String() + "\n" } return result + util.Magenta(" <"+v.MangledName(MANGLE_ARK_UNSTABLE)+"> ") + ")" }
func (v *Function) String() string { result := "(" + util.Blue("Function") + ": " for _, attr := range v.Type.Attrs() { result += attr.String() + " " } result += v.Name for _, par := range v.Parameters { result += " " + par.String() } if v.Type.Return != nil { result += ": " + util.Green(v.Type.Return.TypeName()) + " " } if v.Body != nil { result += v.Body.String() } return result + util.Magenta(" <"+v.MangledName(MANGLE_ARK_UNSTABLE)+">") + ")" }