dump-ast: simplify the tree for already processed cursors