diff --git a/parser/tree-tostring.go b/parser/tree-tostring.go index 79103b5..1f866e6 100644 --- a/parser/tree-tostring.go +++ b/parser/tree-tostring.go @@ -185,8 +185,10 @@ func (section DataSection) ToString (indent int) (output string) { section.permission.ToString(), " ", section.name, ":", section.what.ToString(), "\n") - - output += section.argument.ToString(indent + 1, true) + + if section.argument.kind != ArgumentKindNil { + output += section.argument.ToString(indent + 1, true) + } if section.external { output += doIndent(indent + 1, "external\n") @@ -202,8 +204,10 @@ func (section TypeSection) ToString (indent int) (output string) { section.permission.ToString(), " ", section.name, ":", section.what.ToString(), "\n") - - output += section.argument.ToString(indent + 1, true) + + if section.argument.kind != ArgumentKindNil { + output += section.argument.ToString(indent + 1, true) + } return }