1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use crate::{bytecode_vm::bytecode::errors::FrameError, object::Object};

use super::super::bytecode::instruction::Instruction;

#[derive(Debug)]
pub enum VmError {
    InstructionReadFailure(FrameError),
    InvalidIntegerInstruction(Instruction),
    InvalidBoolInstruction(Instruction),
    InvalidStringInstruction(Instruction),
    TypeNotSame { left: Object, right: Object },
    NotABolean { obj: Object },
    NotAInt { obj: Object },

    JumpConditionNotABolean { obj: Object },
    IndexTargetNotAArray { obj: Object },
    IndexNotAInt { obj: Object },

    NotImplentedInstruction { ins: Instruction },
}