Only rewrite the code if the AST was modified