rewriterewriteR DocumentationInterface for AST rewriting#Description#Interface for AST rewritingUsage#rewrite(ast, rules)CopyArguments#astA language object.rulesA list of functions, each of which is the output from 'make_rule'.Value#A language object.Examples#library(sketch) rewrite( ast = rlang::parse_expr("2 * (3 + pi)"), rules = list(make_rule("pi", "Math.PI"))) rewrite( ast = rlang::parse_expr("2 + pi"), rules = list( make_rule("pi", "Math.PI"), make_rule("+", "Math.add") ))Copy