* copied code from luaL_compilefilex */
| 2331 | * copied code from luaL_compilefilex |
| 2332 | */ |
| 2333 | LUA_API int luaL_compilefile(const char *filename, const char *out_filename, char *error, bool use_type_check, bool is_contract) |
| 2334 | { |
| 2335 | thinkyoung::lua::lib::GluaStateScope scope; |
| 2336 | lua_State* L = scope.L(); |
| 2337 | LoadF lf; |
| 2338 | struct LuaCompileFilePreloadResult pre_result; |
| 2339 | int preload_status = lua_compilefile_preload(L, lf, filename, error, &pre_result, use_type_check, nullptr, is_contract); |
| 2340 | if (preload_status != LUA_OK) |
| 2341 | return preload_status; |
| 2342 | int result_status = lua_compilex(L, getF, &lf, pre_result.chunk_name, "text", writer, out_filename); |
| 2343 | lcompile_error_get(L, error); |
| 2344 | return result_status; |
| 2345 | } |
| 2346 | |
| 2347 | LUA_API int luaL_compilefile_to_stream(lua_State *L, const char *filename, |
| 2348 | GluaModuleByteStreamP stream, char *error, bool use_type_check, bool is_contract) |
no test coverage detected