aboutsummaryrefslogtreecommitdiff
path: root/lstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'lstate.c')
-rw-r--r--lstate.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lstate.c b/lstate.c
index d4bc53eb..86cd5fb8 100644
--- a/lstate.c
+++ b/lstate.c
@@ -443,3 +443,19 @@ void luaE_warning (lua_State *L, const char *msg, int tocont) {
443} 443}
444 444
445 445
446/*
447** Generate a warning from an error message
448*/
449void luaE_warnerror (lua_State *L, const char *where) {
450 TValue *errobj = s2v(L->top - 1); /* error object */
451 const char *msg = (ttisstring(errobj))
452 ? svalue(errobj)
453 : "error object is not a string";
454 /* produce warning "error in %s (%s)" (where, msg) */
455 luaE_warning(L, "error in ", 1);
456 luaE_warning(L, where, 1);
457 luaE_warning(L, " (", 1);
458 luaE_warning(L, msg, 1);
459 luaE_warning(L, ")", 0);
460}
461