MCPcopy Create free account
hub / github.com/ControlCplusControlV/Scribe / optimize_ast

Function optimize_ast

crates/papyrus/src/ast_optimization.rs:8–17  ·  view source on GitHub ↗
(ast: Vec<Expr>)

Source from the content-addressed store, hash-verified

6//TODO: Update this mod and comment the functions
7
8pub 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.

Callers 4

transpile_programFunction · 0.85
run_exampleFunction · 0.85
compile_exampleFunction · 0.85
write_yul_to_masmFunction · 0.85

Calls

no outgoing calls

Tested by 2

run_exampleFunction · 0.68
compile_exampleFunction · 0.68