Don't produce trailing spaces in GenerateOperationsMap
This commit is contained in:
@@ -80,19 +80,16 @@ fun generate(): String {
|
|||||||
val unaryOperationsMapIterator = unaryOperationsMap.iterator()
|
val unaryOperationsMapIterator = unaryOperationsMap.iterator()
|
||||||
while (unaryOperationsMapIterator.hasNext()) {
|
while (unaryOperationsMapIterator.hasNext()) {
|
||||||
val (funcName, parameters) = unaryOperationsMapIterator.next()
|
val (funcName, parameters) = unaryOperationsMapIterator.next()
|
||||||
p.print(
|
p.println(
|
||||||
"unaryOperation(",
|
"unaryOperation(",
|
||||||
parameters.map { it.asSrting() }.makeString(", "),
|
parameters.map { it.asSrting() }.makeString(", "),
|
||||||
", ",
|
", ",
|
||||||
"\"$funcName\"",
|
"\"$funcName\"",
|
||||||
", { a -> a.${funcName}() }, ",
|
", { a -> a.${funcName}() }, ",
|
||||||
renderCheckUnaryOperation(funcName, parameters),
|
renderCheckUnaryOperation(funcName, parameters),
|
||||||
")"
|
")",
|
||||||
|
if (unaryOperationsMapIterator.hasNext()) "," else ""
|
||||||
)
|
)
|
||||||
if (unaryOperationsMapIterator.hasNext()) {
|
|
||||||
p.printWithNoIndent(", ")
|
|
||||||
}
|
|
||||||
p.println()
|
|
||||||
}
|
}
|
||||||
p.popIndent()
|
p.popIndent()
|
||||||
p.println(")")
|
p.println(")")
|
||||||
@@ -106,19 +103,16 @@ fun generate(): String {
|
|||||||
val binaryOperationsMapIterator = binaryOperationsMap.iterator()
|
val binaryOperationsMapIterator = binaryOperationsMap.iterator()
|
||||||
while (binaryOperationsMapIterator.hasNext()) {
|
while (binaryOperationsMapIterator.hasNext()) {
|
||||||
val (funcName, parameters) = binaryOperationsMapIterator.next()
|
val (funcName, parameters) = binaryOperationsMapIterator.next()
|
||||||
p.print(
|
p.println(
|
||||||
"binaryOperation(",
|
"binaryOperation(",
|
||||||
parameters.map { it.asSrting() }.makeString(", "),
|
parameters.map { it.asSrting() }.makeString(", "),
|
||||||
", ",
|
", ",
|
||||||
"\"$funcName\"",
|
"\"$funcName\"",
|
||||||
", { a, b -> a.${funcName}(b) }, ",
|
", { a, b -> a.${funcName}(b) }, ",
|
||||||
renderCheckBinaryOperation(funcName, parameters),
|
renderCheckBinaryOperation(funcName, parameters),
|
||||||
")"
|
")",
|
||||||
|
if (binaryOperationsMapIterator.hasNext()) "," else ""
|
||||||
)
|
)
|
||||||
if (binaryOperationsMapIterator.hasNext()) {
|
|
||||||
p.printWithNoIndent(", ")
|
|
||||||
}
|
|
||||||
p.println()
|
|
||||||
}
|
}
|
||||||
p.popIndent()
|
p.popIndent()
|
||||||
p.println(")")
|
p.println(")")
|
||||||
|
|||||||
Reference in New Issue
Block a user