use crate::ir::IR; #[derive(Debug, Default, PartialEq)] pub struct Block { ir: Vec, } impl Block { pub fn push(&mut self, ir: IR) { self.ir.push(ir); } pub fn pop(&mut self) -> Option { self.ir.pop() } pub fn is_empty(&self) -> bool { self.ir.is_empty() } /// Consumes the block and returns the IR data. pub fn ir(self) -> Vec { self.ir } }