//! This module contains the global asembler context to be passed to functions that need //! it. use std::sync::RwLock; use crate::{model::module_registry::ModuleRegistry, symtab::SymbolTable}; /// Global state to be passed around. pub struct AssemblerContext { pub symbol_table: RwLock, pub module_registry: RwLock, } impl AssemblerContext { pub fn new() -> Self { Self { symbol_table: RwLock::new(SymbolTable::new()), module_registry: RwLock::new(ModuleRegistry::new()), } } }