Skip to main content

luaur_compiler/functions/
cbool.rs

1use crate::enums::type_constant_folding::Type;
2use crate::records::constant::Constant;
3
4pub(crate) fn cbool(v: bool) -> Constant {
5    let mut res = Constant {
6        r#type: Type::Type_Boolean,
7        string_length: 0,
8        data: unsafe { core::mem::zeroed() },
9    };
10
11    unsafe {
12        res.data.value_boolean = v;
13    }
14
15    res
16}