fn second_pass(self) -> Result<Program> {
        let mut code = Vec::new();

        // Replace address labels
        for &(n, ref stmt) in &self.stmts {
            match *stmt {
                Stmt::Data(ref s) => code.push(self.assemble_data(n, s)?),
                Stmt::Instr { instr, ref addr } => code.push(self.assemble_instr(n, instr, addr)?),
            }
        }

        Ok(Program {
            data: code,
            labels: self.labels,
        })
    }
/// Second pass: replace address labels with their corresponding locations.
Second pass: replace address labels with their corresponding locations.
Second pass : replace address labels with their corresponding locations .
fn second_pass(self) -> Result<Program> {
        let mut code = Vec::new();
        // Replace address labels
        for &(n, ref stmt) in &self.stmts {
            match *stmt {
                Stmt::Data(ref s) => code.push(self.assemble_data(n, s)?),
                Stmt::Instr { instr, ref addr } => code.push(self.assemble_instr(n, instr, addr)?),
            }
        }
        Ok(Program {
            data: code,
            labels: self.labels,
        })
    }
fn second_pass ( self ) -> Result < Program > { let mut code = Vec :: new ( ) ; // Replace address labels for & ( n , ref stmt ) in & self . stmts { match * stmt { Stmt :: Data ( ref s ) => code . push ( self . assemble_data ( n , s ) ? ) , Stmt :: Instr { instr , ref addr } => code . push ( self . assemble_instr ( n , instr , addr ) ? ) , } } Ok ( Program { data : code , labels : self . labels , } ) }
Second pass: replace address labels with their corresponding locations.
Second pass : replace address labels with their corresponding locations .
self
self