Skip to main content

luaur_compiler/methods/
compiler_check_constant.rs

1use crate::records::compiler::Compiler;
2use luaur_ast::records::location::Location;
3
4impl Compiler {
5    pub fn check_constant(&mut self, constant: i32, location: &Location) {
6        if constant < 0 {
7            crate::methods::compile_error_raise::compile_error_raise(
8                *location,
9                core::format_args!("Exceeded constant limit; simplify the code to compile"),
10            );
11        }
12    }
13}