[Generator] Always put expression body on a new line

This commit is contained in:
Ilya Gorbunov
2023-08-29 04:43:07 +02:00
committed by Space Team
parent 68a9b9c312
commit 1c149925b7
13 changed files with 463 additions and 277 deletions
@@ -451,7 +451,7 @@ abstract class BasePrimitivesGenerator(private val writer: PrintWriter) : BuiltI
}
val thisCasted = "this${thisKind.castToIfNecessary(opReturnType)}"
val otherCasted = "other${otherKind.castToIfNecessary(opReturnType)}"
"${returnType}($thisCasted, $otherCasted)".addAsSingleLineBody(bodyOnNewLine = true)
"${returnType}($thisCasted, $otherCasted)".setAsExpressionBody()
}.modifyGeneratedRangeTo(thisKind, otherKind, opReturnType)
}
}
@@ -482,7 +482,7 @@ abstract class BasePrimitivesGenerator(private val writer: PrintWriter) : BuiltI
}
returnType = "${opReturnType.capitalized}Range"
}
"this until $parameterName".addAsSingleLineBody(bodyOnNewLine = false)
"this until $parameterName".setAsExpressionBody()
}.modifyGeneratedRangeUntil(thisKind, otherKind, opReturnType)
}
}