1
0
mirror of https://github.com/DanilaFe/abacus synced 2024-11-16 23:53:09 -08:00

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

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];