mirror of
https://github.com/CPunch/Cosmo.git
synced 2025-10-26 10:50:08 +00:00
cvm.c:cosmoV_printError -> cosmoV_printBacktrace
This commit is contained in:
@@ -55,7 +55,7 @@ struct CObjError
|
||||
CCallFrame *frames;
|
||||
int frameCount;
|
||||
int line; // reserved for parser errors
|
||||
bool parserError; // if true, cosmoV_printError will format the error to the lexer
|
||||
bool parserError; // if true, cosmoV_printBacktrace will format the error to the lexer
|
||||
};
|
||||
|
||||
struct CObjObject
|
||||
|
||||
@@ -78,7 +78,7 @@ bool cosmoV_compileString(CState *state, const char *src, const char *name)
|
||||
return false;
|
||||
}
|
||||
|
||||
void cosmoV_printError(CState *state, CObjError *err)
|
||||
void cosmoV_printBacktrace(CState *state, CObjError *err)
|
||||
{
|
||||
// print stack trace
|
||||
for (int i = 0; i < err->frameCount; i++) {
|
||||
@@ -129,7 +129,7 @@ void cosmoV_throw(CState *state)
|
||||
} else {
|
||||
cosmoV_pushValue(state, val);
|
||||
fprintf(stderr, "Unhandled panic! ");
|
||||
cosmoV_printError(state, error);
|
||||
cosmoV_printBacktrace(state, error);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ COSMO_API CObjObject *cosmoV_makeObject(CState *state, int pairs);
|
||||
COSMO_API void cosmoV_makeTable(CState *state, int pairs);
|
||||
COSMO_API void cosmoV_concat(CState *state, int vals);
|
||||
COSMO_API void cosmoV_pushFString(CState *state, const char *format, ...);
|
||||
COSMO_API void cosmoV_printError(CState *state, CObjError *err);
|
||||
COSMO_API void cosmoV_printBacktrace(CState *state, CObjError *err);
|
||||
COSMO_API void cosmoV_throw(CState *state);
|
||||
COSMO_API void cosmoV_error(CState *state, const char *format, ...);
|
||||
COSMO_API void cosmoV_insert(CState *state, int indx, CValue val);
|
||||
|
||||
Reference in New Issue
Block a user