luaur_bytecode/methods/bc_function_inst.rs
1use crate::enums::bc_op_kind::BcOpKind;
2use crate::records::bc_function::BcFunction;
3use crate::records::bc_inst::BcInst;
4use crate::records::bc_op::BcOp;
5use crate::records::bc_ref::BcRef;
6use luaur_common::macros::luau_assert::LUAU_ASSERT;
7
8impl BcFunction {
9 pub fn inst<'a>(&'a self, op: BcOp) -> BcRef<'a, BcInst> {
10 LUAU_ASSERT!(op.kind == BcOpKind::Inst);
11 BcRef {
12 vec: &self.instructions,
13 op,
14 }
15 }
16}