private static Node findLastNode(Node contextNode, Set<Class<? extends Tag>> tags) { if (isTaggedWith(contextNode, tags)) { return contextNode; } List<Node> children = NodeUtil.findNodeChildren(contextNode); for (int i = children.size() - 1; i >= 0; i--) { Node ch = children.get(i); if (ch instanceof WrapperNode) { ch = ((WrapperNode) ch).getDelegateNode(); } Node last = findLastNode(ch, tags); if (last != null) { return last; } } return null; }
Node ch = childNode; if (ch instanceof WrapperNode) { ch = ((WrapperNode) ch).getDelegateNode();
Node ch = childNode; if (ch instanceof WrapperNode) { ch = ((WrapperNode) ch).getDelegateNode();
private static Node findLastNode(Node contextNode, Set<Class<? extends Tag>> tags) { if (isTaggedWith(contextNode, tags)) { return contextNode; } List<Node> children = NodeUtil.findNodeChildren(contextNode); for (int i = children.size() - 1; i >= 0; i--) { Node ch = children.get(i); if (ch instanceof WrapperNode) { ch = ((WrapperNode) ch).getDelegateNode(); } Node last = findLastNode(ch, tags); if (last != null) { return last; } } return null; }
@TruffleBoundary @Override public String toString() { if (body instanceof InstrumentableNode.WrapperNode) { return ((InstrumentableNode.WrapperNode) body).getDelegateNode().toString(); } return body.toString(); } }