| 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) |
| 2349 | { |
| 2350 | LoadF lf; |
| 2351 | struct LuaCompileFilePreloadResult pre_result; |
| 2352 | int preload_status = lua_compilefile_preload(L, lf, filename, error, &pre_result, use_type_check, stream, is_contract); |
| 2353 | if (preload_status != LUA_OK) |
| 2354 | return preload_status; |
| 2355 | if (global_glua_chain_api->has_exception(L)) |
| 2356 | { |
| 2357 | return LUA_ERRRUN; |
| 2358 | } |
| 2359 | int status = lua_compile_to_stream(L, getF, &lf, pre_result.chunk_name, "text", writer_to_stream, stream); |
| 2360 | stream->is_bytes = true; |
| 2361 | lcompile_error_get(L, error); |
| 2362 | return status; |
| 2363 | } |
| 2364 | |
| 2365 | typedef struct LoadS { |
| 2366 | const char *s; |
no test coverage detected