mirror of
https://github.com/DanilaFe/abacus
synced 2026-09-25 21:02:38 +00:00
Abstract the call functionality, and add TreeValueFunctionNode.
This commit is contained in:
@@ -144,7 +144,7 @@ public class ShuntingYardParser implements Parser<Match<TokenType>>, PluginListe
|
||||
while (!matches.isEmpty() && matches.get(0).getType() != TokenType.INTERNAL_FUNCTION_END) {
|
||||
TreeNode argument = constructRecursive(matches);
|
||||
if (argument == null) return null;
|
||||
node.prependChild(argument);
|
||||
node.getChildren().add(0, argument);
|
||||
}
|
||||
if (matches.isEmpty()) return null;
|
||||
matches.remove(0);
|
||||
|
||||
@@ -46,7 +46,7 @@ public class NumberReducer implements Reducer<NumberInterface> {
|
||||
for (int i = 0; i < convertedChildren.length; i++) {
|
||||
convertedChildren[i] = (NumberInterface) children[i];
|
||||
}
|
||||
Function function = abacus.getPluginManager().functionFor(((FunctionNode) node).getFunction());
|
||||
Function function = abacus.getPluginManager().functionFor(((FunctionNode) node).getCallTo());
|
||||
if (function == null) return null;
|
||||
return function.apply(convertedChildren);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user