mod destructure_expression;
mod destructure_program;
mod destructure_statement;
pub mod destructurer;
pub use destructurer::*;
use crate::{Assigner, Pass, TypeTable};
use leo_ast::{Ast, NodeBuilder, ProgramReconstructor};
use leo_errors::Result;
impl<'a> Pass for Destructurer<'a> {
type Input = (Ast, &'a TypeTable, &'a NodeBuilder, &'a Assigner);
type Output = Result<Ast>;
const NAME: &'static str = "Destructurer";
fn do_pass((ast, tt, node_builder, assigner): Self::Input) -> Self::Output {
let mut reconstructor = Destructurer::new(tt, node_builder, assigner);
let program = reconstructor.reconstruct_program(ast.into_repr());
Ok(Ast::new(program))
}
}