Remove unnecessary tokens from the AST.