diff --git a/parser/tree-tostring.go b/parser/tree-tostring.go index 4ce2df8..6dcb2ca 100644 --- a/parser/tree-tostring.go +++ b/parser/tree-tostring.go @@ -258,7 +258,7 @@ func (section *TypeSection) ToString (indent int) (output string) { } func (node TypeNode) ToString (indent int, isRoot bool) (output string) { - doIndent(indent) + output += doIndent(indent) if isRoot { output += "type " } @@ -272,10 +272,12 @@ func (node TypeNode) ToString (indent int, isRoot bool) (output string) { node.defaultValue.kind == ArgumentKindArrayInitializationValues if node.defaultValue.value == nil { + output += "\n" if len(node.children) > 0 { - // TODO: print out members - } else { - output += "\n" + for _, name := range sortMapKeysAlphabetically(node.children) { + child := node.children[name] + output += child.ToString(indent + 1, false) + } } } else if isComplexInitialization { output += "\n"