Taskolib  1.3.3
execute_lua_script.h
Go to the documentation of this file.
1 
23 // SPDX-License-Identifier: LGPL-2.1-or-later
24 
25 #ifndef TASKOLIB_EXECUTE_LUA_SCRIPT_H_
26 #define TASKOLIB_EXECUTE_LUA_SCRIPT_H_
27 
28 #include <string>
29 
30 #include <gul14/expected.h>
31 
32 #include "sol/sol.hpp"
33 
34 namespace task {
35 
47 gul14::expected<sol::object, std::string>
48 execute_lua_script(sol::state& lua, sol::string_view script);
49 
61 gul14::expected<sol::load_result, std::string>
62 load_lua_script(sol::state& lua, sol::string_view script);
63 
64 
65 } // namespace task
66 
67 #endif
Namespace task contains all Taskolib functions and classes.
Definition: CommChannel.h:33
gul14::expected< sol::load_result, std::string > load_lua_script(sol::state &lua, sol::string_view script)
Load a Lua script into the given Lua state and check its syntax without running it.
Definition: execute_lua_script.cc:87
gul14::expected< sol::object, std::string > execute_lua_script(sol::state &lua, sol::string_view script)
Execute a Lua script safely, intercepting all possible exceptions that may occur during its execution...
Definition: execute_lua_script.cc:61