use leo_ast::Function;
use leo_errors::emitter::Handler;
use leo_span::Symbol;
use indexmap::IndexMap;
pub struct CodeGenerator<'a> {
_handler: &'a Handler,
pub(crate) next_register: u64,
pub(crate) current_function: Option<&'a Function>,
pub(crate) variable_mapping: IndexMap<&'a Symbol, String>,
pub(crate) composite_mapping: IndexMap<&'a Symbol, (bool, String)>,
pub(crate) is_transition_function: bool,
pub(crate) in_finalize: bool,
}
impl<'a> CodeGenerator<'a> {
pub fn new(handler: &'a Handler) -> Self {
Self {
_handler: handler,
next_register: 0,
current_function: None,
variable_mapping: IndexMap::new(),
composite_mapping: IndexMap::new(),
is_transition_function: false,
in_finalize: false,
}
}
}