Skip to main content

luaur_bytecode_cli/functions/
report_error_bytecode_alt_b.rs

1use core::ffi::c_char;
2
3use luaur_compiler::records::compile_error::CompileError;
4
5use crate::functions::report::report;
6
7pub fn report_error_c_char_luau_compile_error(name: *const c_char, error: &CompileError) {
8    // The C++ source calls report(name, error.getLocation(), "CompileError", error.what()).
9    // The `report` function in this crate is defined with 4 arguments:
10    // (name: *const c_char, location: &Location, type: *const c_char, message: *const c_char).
11
12    report(
13        name,
14        error.get_location(),
15        c"CompileError".as_ptr(),
16        error.what(),
17    );
18}