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

Temporarily substitute 0 for variables.

This commit is contained in:
Danila Fedorin 2017-08-18 14:21:48 -07:00
parent 1c751353f1
commit e0ff229df4

View File

@ -28,6 +28,8 @@ public class NumberReducer implements Reducer<NumberInterface> {
public NumberInterface reduceNode(TreeNode node, Object... children) { public NumberInterface reduceNode(TreeNode node, Object... children) {
if (node instanceof NumberNode) { if (node instanceof NumberNode) {
return ((NumberNode) node).getNumber(); return ((NumberNode) node).getNumber();
} else if(node instanceof VariableNode) {
return abacus.numberFromString("0");
} else if (node instanceof BinaryNode) { } else if (node instanceof BinaryNode) {
NumberInterface left = (NumberInterface) children[0]; NumberInterface left = (NumberInterface) children[0];
NumberInterface right = (NumberInterface) children[1]; NumberInterface right = (NumberInterface) children[1];