luaur-bytecode 0.1.3

Luau bytecode format and builder (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::records::bc_function::BcFunction;
use crate::records::bc_inst::BcInst;
use crate::records::bc_inst_helper::BcInstHelper;
use crate::records::bc_op::BcOp;
use crate::records::bc_ref::BcRef;

impl BcInstHelper<'_> {
    pub fn prepend_to(&mut self, block: BcOp) {
        unsafe {
            (*self.inst.operator_arrow()).block = block;
        }
        let block_mut = self.graph.block_op(block);
        block_mut.ops.push_front(self.inst.op);
    }
}