use super::{ Address, Program }; impl Program { pub(crate) fn remove_definition_addresses(&mut self) { for instr in &mut self.instructions { for arg in &mut instr.args { if let Address::Definitions(name) = arg { *arg = self.definitions[name].clone(); } } } self.definitions.clear(); } pub(crate) fn analyze(&self) { for instr in &self.instructions { let result = instr.check_args(); if result.is_err() { panic!("Instruction '{}' error: {:?}", instr.name, result.err().unwrap()); } } } }