use crate::asm_lang::allocated_ops::AllocatedOp;
use std::fmt;
/// An [InstructionSet] is produced by allocating registers on an [AbstractInstructionSet].
#[derive(Clone)]
pub struct InstructionSet {
pub(crate) ops: Vec<AllocatedOp>,
}
impl fmt::Display for InstructionSet {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
".program:\n{}",
self.ops
.iter()
.map(|x| format!("{}", x))
.collect::<Vec<_>>()
.join("\n")
)
}
}