}
private void checkNodeClose() {
Node node = nodeStack.pop();
if (node == null) return;
Position p = node.getPosition();
if (p.isUnplaced()) return; //opener already generated error.
if (p.getStart() > p.getEnd()) problems.add(new AstException(node, "Node ends before it starts."));
int delta = p.getEnd() - Math.max(getCurrentPosition(false), p.getStart());
if (delta != 0) {
int actualPos = getCurrentPosition(false);
int repPos = p.getEnd();
reportError(node, "end", actualPos, repPos);
}
}