mirror of
https://github.com/DanilaFe/abacus
synced 2024-12-22 07:20:09 -08:00
Use the variable database for the number reducer.
This commit is contained in:
parent
146f3994ef
commit
428df8bfd3
|
@ -35,7 +35,7 @@ public class NumberReducer implements Reducer<NumberInterface> {
|
||||||
if (node instanceof NumberNode) {
|
if (node instanceof NumberNode) {
|
||||||
return abacus.getNumberImplementation().instanceForString(((NumberNode) node).getNumber());
|
return abacus.getNumberImplementation().instanceForString(((NumberNode) node).getNumber());
|
||||||
} else if (node instanceof VariableNode) {
|
} else if (node instanceof VariableNode) {
|
||||||
return abacus.getNumberImplementation().instanceForString("0");
|
return abacus.getVariableDatabase().getVariableValue(((VariableNode) node).getVariable());
|
||||||
} else if (node instanceof NumberBinaryNode) {
|
} else if (node instanceof NumberBinaryNode) {
|
||||||
NumberInterface left = (NumberInterface) children[0];
|
NumberInterface left = (NumberInterface) children[0];
|
||||||
NumberInterface right = (NumberInterface) children[1];
|
NumberInterface right = (NumberInterface) children[1];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user