1
0
mirror of https://github.com/DanilaFe/abacus synced 2026-01-10 17:25:19 +00:00

Fix several bugs and register operations as operations.

This commit is contained in:
2017-07-27 14:15:45 -07:00
parent 5c9c718283
commit 381c88f7a0
3 changed files with 12 additions and 10 deletions

View File

@@ -30,7 +30,7 @@ public class NumberReducer implements Reducer<NumberInterface> {
} else if(node instanceof OpNode){
NumberInterface left = (NumberInterface) children[0];
NumberInterface right = (NumberInterface) children[1];
Function function = manager.functionFor(((OpNode) node).getOperation());
Function function = manager.operatorFor(((OpNode) node).getOperation()).getFunction();
if(function == null) return null;
return function.apply(left, right);
} else if(node instanceof FunctionNode){