From 428df8bfd3929d4eb0a9997a7634350d47df299b Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Fri, 1 Sep 2017 23:55:50 -0700 Subject: [PATCH] Use the variable database for the number reducer. --- core/src/main/java/org/nwapw/abacus/tree/NumberReducer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 5d497ec..5ca1ee2 100644 --- a/core/src/main/java/org/nwapw/abacus/tree/NumberReducer.java +++ b/core/src/main/java/org/nwapw/abacus/tree/NumberReducer.java @@ -35,7 +35,7 @@ public class NumberReducer implements Reducer { if (node instanceof NumberNode) { return abacus.getNumberImplementation().instanceForString(((NumberNode) node).getNumber()); } else if (node instanceof VariableNode) { - return abacus.getNumberImplementation().instanceForString("0"); + return abacus.getVariableDatabase().getVariableValue(((VariableNode) node).getVariable()); } else if (node instanceof NumberBinaryNode) { NumberInterface left = (NumberInterface) children[0]; NumberInterface right = (NumberInterface) children[1];