Skip to main content

luaur_bytecode/methods/
bytecode_builder_add_constant_nil.rs

1use crate::records::bytecode_builder::BytecodeBuilder;
2use crate::records::constant::Constant;
3use crate::records::constant::ConstantValue;
4use crate::records::constant_key::ConstantKey;
5
6impl BytecodeBuilder {
7    pub fn add_constant_nil(&mut self) -> i32 {
8        let c = Constant {
9            r#type: crate::enums::r#type::Type::Type_Nil,
10            value: ConstantValue {
11                valueBoolean: false,
12            },
13        };
14
15        let k = ConstantKey {
16            r#type: crate::enums::r#type::Type::Type_Nil,
17            value: 0,
18            extra: 0,
19        };
20
21        self.add_constant(k, c)
22    }
23}