use crate::asm_lang::allocated_ops::AllocatedOp;
use std::fmt;
#[derive(Clone)]
pub enum InstructionSet {
Fuel {
ops: Vec<AllocatedOp>,
},
Evm {
ops: Vec<etk_asm::ops::AbstractOp>,
},
MidenVM {
ops: Vec<crate::asm_generation::DirectOp>,
},
}
impl fmt::Display for InstructionSet {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
".program:\n{}",
match self {
InstructionSet::Fuel { ops } => ops
.iter()
.map(|x| format!("{x}"))
.collect::<Vec<_>>()
.join("\n"),
InstructionSet::Evm { ops } => ops
.iter()
.map(|x| format!("{x}"))
.collect::<Vec<_>>()
.join("\n"),
InstructionSet::MidenVM { ops } => {
ops.iter()
.map(|x| format!("{x}"))
.collect::<Vec<_>>()
.join("\n")
}
}
)
}
}