A postfix-walk + make-node to compact is MUCH simpler, and only requires one pass.