Type members actually get ToString'd now
This commit is contained in:
parent
06f9b5b71c
commit
23072b5476
@ -66,24 +66,6 @@ func (identifier Identifier) ToString () (output string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (member TypeSectionMember) ToString (indent int, breakLine bool) (output string) {
|
|
||||||
output += doIndent(indent, ".")
|
|
||||||
|
|
||||||
output += member.permission.ToString() + " "
|
|
||||||
output += member.name + ":"
|
|
||||||
output += member.what.ToString()
|
|
||||||
|
|
||||||
if member.bitWidth > 0 {
|
|
||||||
output += fmt.Sprint(" & ", member.bitWidth)
|
|
||||||
}
|
|
||||||
|
|
||||||
if breakLine {
|
|
||||||
output += "\n"
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (what Type) ToString () (output string) {
|
func (what Type) ToString () (output string) {
|
||||||
if what.kind == TypeKindNil {
|
if what.kind == TypeKindNil {
|
||||||
output += "NIL-TYPE"
|
output += "NIL-TYPE"
|
||||||
@ -202,6 +184,27 @@ func (section DataSection) ToString (indent int) (output string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (member TypeSectionMember) ToString (indent int) (output string) {
|
||||||
|
output += doIndent(indent, member.permission.ToString())
|
||||||
|
|
||||||
|
if member.what.kind != TypeKindNil {
|
||||||
|
output += " " + member.name + ":"
|
||||||
|
output += member.what.ToString()
|
||||||
|
}
|
||||||
|
|
||||||
|
if member.argument.kind != ArgumentKindNil {
|
||||||
|
output += " " + member.argument.ToString(indent, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
if member.bitWidth > 0 {
|
||||||
|
output += fmt.Sprint(" & ", member.bitWidth)
|
||||||
|
}
|
||||||
|
|
||||||
|
output += "\n"
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func (section TypeSection) ToString (indent int) (output string) {
|
func (section TypeSection) ToString (indent int) (output string) {
|
||||||
output += doIndent (
|
output += doIndent (
|
||||||
indent,
|
indent,
|
||||||
@ -213,6 +216,10 @@ func (section TypeSection) ToString (indent int) (output string) {
|
|||||||
if section.argument.kind != ArgumentKindNil {
|
if section.argument.kind != ArgumentKindNil {
|
||||||
output += section.argument.ToString(indent + 1, true)
|
output += section.argument.ToString(indent + 1, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, member := range section.members {
|
||||||
|
output += member.ToString(indent + 1)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user