| 80 | } |
| 81 | |
| 82 | struct to_lua_object |
| 83 | { |
| 84 | to_lua_object(sol::state &state) : state(state) {} |
| 85 | template <typename T> auto operator()(T &v) const { return sol::make_object(state, v); } |
| 86 | auto operator()(std::monostate) const { return sol::make_object(state, sol::lua_nil); } |
| 87 | sol::state &state; |
| 88 | }; |
| 89 | } // namespace |
| 90 | |
| 91 | // Handle a lua error thrown in a protected function by printing the traceback and bubbling |