Set phrase initialization values ToString correctly
This commit is contained in:
parent
bf2839508d
commit
16e06aacb8
@ -429,10 +429,19 @@ func (phrase Phrase) ToString (indent int, ownLine bool) (output string) {
|
|||||||
output += doIndent(indent)
|
output += doIndent(indent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var initializationValues Argument
|
||||||
|
|
||||||
output += "[" + phrase.command.ToString(0, false)
|
output += "[" + phrase.command.ToString(0, false)
|
||||||
for _, argument := range phrase.arguments {
|
for _, argument := range phrase.arguments {
|
||||||
|
isInitializationValue :=
|
||||||
|
argument.kind == ArgumentKindObjectInitializationValues ||
|
||||||
|
argument.kind == ArgumentKindArrayInitializationValues
|
||||||
|
if isInitializationValue {
|
||||||
|
initializationValues = argument
|
||||||
|
} else {
|
||||||
output += " " + argument.ToString(0, false)
|
output += " " + argument.ToString(0, false)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
output += "]"
|
output += "]"
|
||||||
|
|
||||||
if len(phrase.returnsTo) > 0 {
|
if len(phrase.returnsTo) > 0 {
|
||||||
@ -444,6 +453,9 @@ func (phrase Phrase) ToString (indent int, ownLine bool) (output string) {
|
|||||||
|
|
||||||
if ownLine {
|
if ownLine {
|
||||||
output += "\n"
|
output += "\n"
|
||||||
|
if initializationValues.kind != ArgumentKindNil {
|
||||||
|
output += initializationValues.ToString(indent + 1, true)
|
||||||
|
}
|
||||||
output += phrase.block.ToString(indent + 1)
|
output += phrase.block.ToString(indent + 1)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user