[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: luaL_where
- From: "Patrick Donnelly" <batrick.donnelly@...>
- Date: Mon, 25 Feb 2008 01:27:37 -0700
lbaselib.c (for the error() function) uses luaL_where:
static int luaB_error (lua_State *L) {
int level = luaL_optint(L, 2, 1);
lua_settop(L, 1);
if (lua_isstring(L, 1) && level > 0) { /* add extra information? */
luaL_where(L, level);
lua_pushvalue(L, 1);
lua_concat(L, 2);
}
return lua_error(L);
}
You can see how the "chunkname:linenumber: errormsg" is generated :)
Cheers,
--
-Patrick Donnelly
"One of the lessons of history is that nothing is often a good thing
to do and always a clever thing to say."
-Will Durant