luaur-compiler 0.1.3

Luau source-to-bytecode compiler (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::enums::type_constant_folding::Type;
use crate::records::compiler::Compiler;
use luaur_ast::records::ast_expr::AstExpr;

impl Compiler {
    pub fn is_constant_integer(&mut self, node: *mut AstExpr) -> bool {
        if let Some(cv) = self.constants.find(&node) {
            return cv.r#type == Type::Type_Integer;
        }
        false
    }
}