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
|
|
|
|
|
//
|
2021-02-17 13:38:22 -05:00
|
|
|
// Given a coroutine which contains an error message, pop the error
|
|
|
|
|
// message from the coroutine, and push a traceback onto L.
|
2021-01-12 14:14:38 -05:00
|
|
|
//
|
2021-02-17 13:38:22 -05:00
|
|
|
void traceback_coroutine(lua_State *L, lua_State *CO);
|
2021-01-12 14:14:38 -05:00
|
|
|
|
|
|
|
|
// traceback_pcall
|
|
|
|
|
//
|
|
|
|
|
// same as lua_pcall, except that it automatically supplies traceback_handler as
|
|
|
|
|
// a message handler.
|
|
|
|
|
//
|
2021-01-02 13:31:18 -05:00
|
|
|
int traceback_pcall(lua_State *L, int narg, int nret);
|
|
|
|
|
|
|
|
|
|
#endif // TRACEBACK_HPP
|