Fixed extraneous newlines after complex initialization values
This commit is contained in:
parent
9ca1be2204
commit
0ad1c0b2f4
@ -169,24 +169,29 @@ func (argument *Argument) ToString (indent int, breakLine bool) (output string)
|
|||||||
output += doIndent (
|
output += doIndent (
|
||||||
indent,
|
indent,
|
||||||
argument.value.(*Identifier).ToString())
|
argument.value.(*Identifier).ToString())
|
||||||
|
if breakLine { output += "\n" }
|
||||||
|
|
||||||
case ArgumentKindDeclaration:
|
case ArgumentKindDeclaration:
|
||||||
output += doIndent (
|
output += doIndent (
|
||||||
indent,
|
indent,
|
||||||
argument.value.(*Declaration).ToString())
|
argument.value.(*Declaration).ToString())
|
||||||
|
if breakLine { output += "\n" }
|
||||||
|
|
||||||
case ArgumentKindInt, ArgumentKindUInt, ArgumentKindFloat:
|
case ArgumentKindInt, ArgumentKindUInt, ArgumentKindFloat:
|
||||||
output += doIndent(indent, fmt.Sprint(argument.value))
|
output += doIndent(indent, fmt.Sprint(argument.value))
|
||||||
|
if breakLine { output += "\n" }
|
||||||
|
|
||||||
case ArgumentKindString:
|
case ArgumentKindString:
|
||||||
output += doIndent (
|
output += doIndent (
|
||||||
indent,
|
indent,
|
||||||
"\"" + argument.value.(string) + "\"")
|
"\"" + argument.value.(string) + "\"")
|
||||||
|
if breakLine { output += "\n" }
|
||||||
|
|
||||||
case ArgumentKindRune:
|
case ArgumentKindRune:
|
||||||
output += doIndent (
|
output += doIndent (
|
||||||
indent,
|
indent,
|
||||||
"'" + string(argument.value.(rune)) + "'")
|
"'" + string(argument.value.(rune)) + "'")
|
||||||
|
if breakLine { output += "\n" }
|
||||||
|
|
||||||
case ArgumentKindOperator:
|
case ArgumentKindOperator:
|
||||||
// TODO
|
// TODO
|
||||||
@ -195,7 +200,6 @@ func (argument *Argument) ToString (indent int, breakLine bool) (output string)
|
|||||||
// phrase command.
|
// phrase command.
|
||||||
}
|
}
|
||||||
|
|
||||||
if breakLine { output += "\n" }
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user