Skip to main content

luaur_compiler/methods/
compiler_is_constant_vector.rs

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