Skip to content

Commit

Permalink
Adopt ExpressionNode before executing it
Browse files Browse the repository at this point in the history
  • Loading branch information
JaroslavTulach committed Aug 8, 2023
1 parent 5bcea5a commit d1b5913
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,15 @@ protected ExecutableNode parse(InlineParsingRequest request) throws InlineParsin
if (exprNode.isDefined()) {
var language = EnsoLanguage.get(exprNode.get());
return new ExecutableNode(language) {
@Child
private ExpressionNode expr;

@Override
public Object execute(VirtualFrame frame) {
return exprNode.get().executeGeneric(frame);
if (expr == null) {
expr = insert(exprNode.get());
}
return expr.executeGeneric(frame);
}
};
}
Expand Down

0 comments on commit d1b5913

Please sign in to comment.