From 3a38465368b32a1277f4f304f351d2e94ec9d3e2 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Tue, 27 Sep 2022 18:43:40 -0400 Subject: [PATCH] Fixed DataSection/TypeSection.ToString --- parser/tree-tostring.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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 }