change: add option to perform rewrite on AST