(ast: Vec<Expr>)
| 6 | //TODO: Update this mod and comment the functions |
| 7 | |
| 8 | pub fn optimize_ast(ast: Vec<Expr>) -> Vec<Expr> { |
| 9 | // let mut assignment_visitor = VariableAssignmentVisitor::default(); |
| 10 | // let ast = walk_ast(ast, &mut assignment_visitor); |
| 11 | // let const_variables = assignment_visitor.get_const_variables(); |
| 12 | // let ast = walk_ast(ast, &mut ConstVariableVisitor { const_variables }); |
| 13 | |
| 14 | // walk_ast(ast, &mut ForLoopToRepeatVisitor {}) |
| 15 | // TODO: fix optimizations |
| 16 | ast |
| 17 | } |
| 18 | |
| 19 | // Walks through each expression in the abstract syntax tree, optimizing the AST where possible. A new, optimized AST is returned |
| 20 | //Which is then passed into the Miden generation logic. |
no outgoing calls