1
0
mirror of https://github.com/DanilaFe/abacus synced 2024-12-22 07:20:09 -08:00

Merge pull request #55 from DanilaFe/unary-minus-fix

Fix bug causing incorrect parsing of inputs with negative signs.
This commit is contained in:
Danila Fedorin 2018-01-30 21:12:29 -08:00 committed by GitHub
commit ef39bcbaa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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