Use the variable database for the number reducer.

This commit is contained in:
Danila Fedorin 2017-09-01 23:55:50 -07:00
parent 146f3994ef
commit 428df8bfd3
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ public class NumberReducer implements Reducer<NumberInterface> {
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];