remove duplicates (last def wins) from parse tree