Fixed extraneous newlines after complex initialization values
This commit is contained in:
		
							parent
							
								
									9ca1be2204
								
							
						
					
					
						commit
						0ad1c0b2f4
					
				| @ -158,35 +158,40 @@ func (argument *Argument) ToString (indent int, breakLine bool) (output string) | |||||||
| 	case ArgumentKindObjectInitializationValues: | 	case ArgumentKindObjectInitializationValues: | ||||||
| 		// this should only appear in contexts where breakLine is true | 		// this should only appear in contexts where breakLine is true | ||||||
| 		output += argument.value.(*ObjectInitializationValues). | 		output += argument.value.(*ObjectInitializationValues). | ||||||
| 				ToString (indent) | 				ToString(indent) | ||||||
| 	 | 	 | ||||||
| 	case ArgumentKindArrayInitializationValues: | 	case ArgumentKindArrayInitializationValues: | ||||||
| 		// this should only appear in contexts where breakLine is true | 		// this should only appear in contexts where breakLine is true | ||||||
| 		output += argument.value.(*ArrayInitializationValues). | 		output += argument.value.(*ArrayInitializationValues). | ||||||
| 				ToString (indent) | 				ToString(indent) | ||||||
| 	 | 	 | ||||||
| 	case ArgumentKindIdentifier: | 	case ArgumentKindIdentifier: | ||||||
| 		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