luaur_compile_cli/functions/report.rs
1use core::ffi::{c_char, CStr};
2
3use luaur_ast::records::location::Location;
4
5pub fn report(name: *const c_char, location: &Location, r#type: &str, message: &str) {
6 let name = unsafe { CStr::from_ptr(name).to_string_lossy() };
7
8 eprintln!(
9 "{}({},{}): {}: {}",
10 name,
11 location.begin.line + 1,
12 location.begin.column + 1,
13 r#type,
14 message
15 );
16}