Fixed func ToString and test case

This commit is contained in:
Sasha Koshka 2022-09-17 12:22:17 -04:00
parent 49eb7f9b9d
commit 77acfd1cf2
2 changed files with 9 additions and 7 deletions

View File

@ -101,10 +101,9 @@ func ro gControlFlow
[otherThing] [otherThing]
func ro hSetPhrase func ro hSetPhrase
--- ---
let x:Int:<3> [let x:Int:<3>]
let y:{Int}:<[loc x]> [let y:{Int}:<[loc x]>]
let z:Int:8:<398 9 2309 983 -2387 478 555 123> [let z:Int:8:<398 9 2309 983 -2387 478 555 123>]
let bird:Bird:(.that:(.whenYou:<99999>) .this:<324>) [let bird:Bird:(.that:(.whenYou:<99999>) .this:<324>)]
`, test) `, test)
} }

View File

@ -76,7 +76,9 @@ func (values ObjectDefaultValues) ToString (
output += doIndent(indent, "(") output += doIndent(indent, "(")
if breakLine { output += "\n" } if breakLine { output += "\n" }
for _, name := range sortMapKeysAlphabetically(values) { for index, name := range sortMapKeysAlphabetically(values) {
if index > 0 && !breakLine { output += " " }
value := values[name] value := values[name]
output += doIndent(indent, "." + name + ":") output += doIndent(indent, "." + name + ":")
@ -109,7 +111,8 @@ func (values ArrayDefaultValues) ToString (
output += doIndent(indent, "<") output += doIndent(indent, "<")
if breakLine { output += "\n" } if breakLine { output += "\n" }
for _, value := range values { for index, value := range values {
if index > 0 && !breakLine { output += " " }
output += value.ToString(indent, breakLine) output += value.ToString(indent, breakLine)
} }