From e0ff229df4dda6bdcd6a2ebbc6c7710c3acd0cef Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Fri, 18 Aug 2017 14:21:48 -0700 Subject: [PATCH] Temporarily substitute 0 for variables. --- core/src/main/java/org/nwapw/abacus/tree/NumberReducer.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/main/java/org/nwapw/abacus/tree/NumberReducer.java b/core/src/main/java/org/nwapw/abacus/tree/NumberReducer.java index 8584231..1cda9a5 100644 --- a/core/src/main/java/org/nwapw/abacus/tree/NumberReducer.java +++ b/core/src/main/java/org/nwapw/abacus/tree/NumberReducer.java @@ -28,6 +28,8 @@ public class NumberReducer implements Reducer { public NumberInterface reduceNode(TreeNode node, Object... children) { if (node instanceof NumberNode) { return ((NumberNode) node).getNumber(); + } else if(node instanceof VariableNode) { + return abacus.numberFromString("0"); } else if (node instanceof BinaryNode) { NumberInterface left = (NumberInterface) children[0]; NumberInterface right = (NumberInterface) children[1];