[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: luaL_where
- From: "Wesley Smith" <wesley.hoke@...>
- Date: Mon, 25 Feb 2008 00:36:55 -0800
Ahhhhh,
Thanks,
wes
On Mon, Feb 25, 2008 at 12:27 AM, Patrick Donnelly
<batrick.donnelly@gmail.com> wrote:
> 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
>