Minor. Use property instead of deprecated function in Operations map
This commit is contained in:
+1
-1
@@ -98,7 +98,7 @@ internal val unaryOperations: HashMap<UnaryOperationKey<*>, Pair<Function1<Any?,
|
||||
unaryOperation(SHORT, "unaryMinus", { a -> a.unaryMinus() }, { a -> a.unaryMinus() }),
|
||||
unaryOperation(SHORT, "unaryPlus", { a -> a.unaryPlus() }, emptyUnaryFun),
|
||||
unaryOperation(SHORT, "toString", { a -> a.toString() }, emptyUnaryFun),
|
||||
unaryOperation(STRING, "length", { a -> a.length() }, emptyUnaryFun),
|
||||
unaryOperation(STRING, "length", { a -> a.length }, emptyUnaryFun),
|
||||
unaryOperation(STRING, "toString", { a -> a.toString() }, emptyUnaryFun)
|
||||
)
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ fun generate(): String {
|
||||
val unaryOperationsMapIterator = unaryOperationsMap.iterator()
|
||||
while (unaryOperationsMapIterator.hasNext()) {
|
||||
val (funcName, parameters, isFunction) = unaryOperationsMapIterator.next()
|
||||
val parenthesesOrBlank = "()" //if (isFunction) "()" else ""
|
||||
val parenthesesOrBlank = if (isFunction) "()" else ""
|
||||
p.println(
|
||||
"unaryOperation(",
|
||||
parameters.map { it.asString() }.joinToString(", "),
|
||||
|
||||
Reference in New Issue
Block a user