Fixed ToString of type nodes
This commit is contained in:
parent
2296765e81
commit
9b4279c052
@ -258,7 +258,7 @@ func (section *TypeSection) ToString (indent int) (output string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (node TypeNode) ToString (indent int, isRoot bool) (output string) {
|
func (node TypeNode) ToString (indent int, isRoot bool) (output string) {
|
||||||
doIndent(indent)
|
output += doIndent(indent)
|
||||||
if isRoot {
|
if isRoot {
|
||||||
output += "type "
|
output += "type "
|
||||||
}
|
}
|
||||||
@ -272,10 +272,12 @@ func (node TypeNode) ToString (indent int, isRoot bool) (output string) {
|
|||||||
node.defaultValue.kind == ArgumentKindArrayInitializationValues
|
node.defaultValue.kind == ArgumentKindArrayInitializationValues
|
||||||
|
|
||||||
if node.defaultValue.value == nil {
|
if node.defaultValue.value == nil {
|
||||||
|
output += "\n"
|
||||||
if len(node.children) > 0 {
|
if len(node.children) > 0 {
|
||||||
// TODO: print out members
|
for _, name := range sortMapKeysAlphabetically(node.children) {
|
||||||
} else {
|
child := node.children[name]
|
||||||
output += "\n"
|
output += child.ToString(indent + 1, false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if isComplexInitialization {
|
} else if isComplexInitialization {
|
||||||
output += "\n"
|
output += "\n"
|
||||||
|
Reference in New Issue
Block a user