Browse Source

Fix bug causing incorrect parsing of inputs with negative signs.

unary-minus-fix
Danila Fedorin 4 years ago
parent
commit
ac17246317
  1. 2
      core/src/main/kotlin/org/nwapw/abacus/plugin/standard/operator/OperatorNegate.kt

2
core/src/main/kotlin/org/nwapw/abacus/plugin/standard/operator/OperatorNegate.kt

@ -11,7 +11,7 @@ import org.nwapw.abacus.number.NumberInterface
*
* This is a standard operator that negates a number.
*/
class OperatorNegate: NumberOperator(OperatorAssociativity.LEFT, OperatorType.UNARY_PREFIX, 0) {
class OperatorNegate: NumberOperator(OperatorAssociativity.LEFT, OperatorType.UNARY_PREFIX, 1) {
override fun matchesParams(context: PluginEvaluationContext, params: Array<out NumberInterface>) =
params.size == 1

Loading…
Cancel
Save