use crate::vm::instruction::{ArgumentCount, ConstantId, ImmediateInteger, Instruction, LocalId};

#[derive(Debug, Clone, Copy)]
pub enum Emitted {
    Branch(usize),
    Jump(usize),
    Instruction(Instruction),
    LocalId(LocalId),
    ConstantId(ConstantId),
    ArgumentCount(ArgumentCount),
    ImmediateInteger(ImmediateInteger),
    Bool(bool),
    // Instruction(Instruction),
}

impl From<Instruction> for Emitted {
    fn from(value: Instruction) -> Self {
        Self::Instruction(value)
    }
}

impl From<LocalId> for Emitted {
    fn from(value: LocalId) -> Self {
        Self::LocalId(value)
    }
}
impl From<ConstantId> for Emitted {
    fn from(value: ConstantId) -> Self {
        Self::ConstantId(value)
    }
}
impl From<ArgumentCount> for Emitted {
    fn from(value: ArgumentCount) -> Self {
        Self::ArgumentCount(value)
    }
}
impl From<ImmediateInteger> for Emitted {
    fn from(value: ImmediateInteger) -> Self {
        Self::ImmediateInteger(value)
    }
}
impl From<bool> for Emitted {
    fn from(value: bool) -> Self {
        Self::Bool(value)
    }
}
