use crate::records::scope::Scope;
use crate::records::stringifier_state::StringifierState;
use alloc::format;
use alloc::sync::Arc;
impl StringifierState {
pub fn emit_level(&mut self, scope: *mut Scope) {
unsafe {
let mut count: usize = 0;
let mut s = scope as *const Scope;
while !s.is_null() {
count += 1;
s = match &(*s).parent {
Some(p) => Arc::as_ptr(p),
None => core::ptr::null(),
};
}
self.emit(&count);
if luaur_common::FInt::DebugLuauVerboseTypeNames.get() >= 3 {
self.emit("-");
let v = (scope as usize as u32) & 0xFFFFFF;
let buffer = format!("0x{:x}", v);
self.emit(buffer.as_str());
}
}
}
}