// returns true if it worked ok static bool expandEllipsis(OccTree2 tree) { bool ok = true; OccTree2 node = null; int safety = 0; while (++safety < 1000 && (node = findNode(tree, E.state("..."))) != null) { OccTree2 p = node.parent; L l = findNodes(tree, p.e); l.remove(p); if (empty(l)) { print("Couldn't expand ellipsis after " + p.e); ok = false; } p.replaceWith(cloneOccTree(first(l))); } if (node != null) { print("Expand ellipsis: Warning - Safety count reached (" + safety + ")"); ok = false; } ret ok; }