Skip to main content

luaur_bytecode/records/
bc_vm_const.rs

1use crate::enums::bc_vm_const_kind::BcVmConstKind;
2
3#[repr(C)]
4#[derive(Debug, Clone, Copy)]
5pub struct BcVmConst {
6    pub kind: BcVmConstKind,
7    pub value: BcVmConstValue,
8}
9
10#[repr(C)]
11#[derive(Clone, Copy)]
12pub union BcVmConstValue {
13    pub valueBoolean: bool,
14    pub valueNumber: f64,
15    pub valueVector: [f32; 4],
16    pub valueString: &'static str,
17    pub valueImport: u32,
18    pub valueTable: u32,
19    pub valueClosure: u32,
20    pub valueInteger: i64,
21}
22
23impl core::fmt::Debug for BcVmConstValue {
24    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
25        f.write_str("BcVmConstValue(..)")
26    }
27}