luaur_compiler/methods/
compiler_at_top_level.rs1use crate::records::compiler::Compiler;
2
3impl Compiler {
4 pub fn at_top_level(&self) -> bool {
5 !self.current_function.is_null()
6 && unsafe { (*self.current_function).function_depth == 0 }
7 && self.block_depth == 0
8 && self.loops.is_empty()
9 }
10}