luaur-compiler 0.1.3

Luau source-to-bytecode compiler (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
use crate::enums::type_constant_folding::Type;
use luaur_common::macros::luau_assert::LUAU_ASSERT;

impl crate::records::constant::Constant {
    pub fn is_truthful(&self) -> bool {
        LUAU_ASSERT!(self.r#type != Type::Type_Unknown);
        self.r#type != Type::Type_Nil
            && !(self.r#type == Type::Type_Boolean && unsafe { self.data.value_boolean } == false)
    }
}