From 97cb6e54eb41e5a015a7b05eea2b2c77dd15b0d7 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Tue, 16 Aug 2022 20:53:27 -0400 Subject: [PATCH] Type.ToString now understands array lengths --- parser/tree-tostring.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/parser/tree-tostring.go b/parser/tree-tostring.go index 6ce75ec..f598807 100644 --- a/parser/tree-tostring.go +++ b/parser/tree-tostring.go @@ -52,6 +52,16 @@ func (what *Type) ToString () (output string) { } else { output += "{" output += what.points.ToString() + + if what.kind == TypeKindArray { + output += " " + if what.length == 0 { + output += ".." + } else { + output += fmt.Sprint(what.length) + } + } + output += "}" } @@ -164,6 +174,9 @@ func (argument *Argument) ToString (indent int, breakLine bool) (output string) case ArgumentKindOperator: // TODO + // also when parsing this argument kind, don't do it in the + // argument parsing function. do it specifically when parsing a + // phrase command. } if breakLine { output += "\n" }