Skip to main content

luaur_compiler/methods/
compiler_is_constant_integer.rs

1use crate::enums::type_constant_folding::Type;
2use crate::records::compiler::Compiler;
3use luaur_ast::records::ast_expr::AstExpr;
4
5impl Compiler {
6    pub fn is_constant_integer(&mut self, node: *mut AstExpr) -> bool {
7        if let Some(cv) = self.constants.find(&node) {
8            return cv.r#type == Type::Type_Integer;
9        }
10        false
11    }
12}