elect
return
fun getArgCount(): Int { when (lastToken) { null -> return 1 is Token.OpenParentheses, is Token.ArgumentSeparator -> { return 1 } else -> (lastToken as? Token.Operator)?.operator?.let { lastOp -> if (lastOp.numOperands == 2 || lastOp.numOperands == 1 && !lastOp.isLeftAssociative) return 1 } } return 2 }
fun getArgCount(): Int = when (lastToken) { null -> 1 is Token.OpenParentheses, is Token.ArgumentSeparator -> 1 else -> { val lastOp = (lastToken as? Token.Operator)?.operator when { lastOp != null && (lastOp.numOperands == 2 || lastOp.numOperands == 1 && !lastOp.isLeftAssociative) -> 1 else -> 2 } } }
Kroppeb
A modern programming language that makes developers happier.