Files
integration/luprex/core/cpp/traceback.hpp

33 lines
854 B
C++
Raw Normal View History

2021-01-02 13:31:18 -05:00
/////////////////////////////////////////////////////////////////
//
2021-01-12 14:14:38 -05:00
// TRACEBACK ROUTINES
2021-01-02 13:31:18 -05:00
//
2021-01-12 14:14:38 -05:00
// The following routines are meant to help produce good-quality
// tracebacks from errors in lua code.
2021-01-02 13:31:18 -05:00
//
/////////////////////////////////////////////////////////////////
2021-01-12 14:14:38 -05:00
2021-01-02 13:31:18 -05:00
#ifndef TRACEBACK_HPP
#define TRACEBACK_HPP
#include "luastack.hpp"
2021-01-12 14:14:38 -05:00
// traceback_coroutine
//
// Given a coroutine which contains an error message, replace
// the error message with a full traceback. Always returns 1.
2021-01-12 14:14:38 -05:00
//
int traceback_coroutine(lua_State *L);
2021-01-12 14:14:38 -05:00
// traceback_pcall
//
// Similar to lua_pcall, except that it automatically supplies
// traceback_coroutine as a message handler. It also automatically
// returns any error message. Returns empty string if there's
// no error.
2021-01-12 14:14:38 -05:00
//
eng::string traceback_pcall(lua_State *L, int narg, int nret);
2021-01-02 13:31:18 -05:00
#endif // TRACEBACK_HPP