Several details in code (e.g., moving a variable to the most inner
scope that encloses its uses), comments, parameter names, extra tests.
This commit is contained in:
Roberto Ierusalimschy
2020-02-27 12:59:22 -03:00
parent 9b7987a9d1
commit 6eb53b7526
13 changed files with 52 additions and 45 deletions

View File

@@ -101,7 +101,7 @@ int luaG_getfuncline (const Proto *f, int pc) {
}
static int currentline (CallInfo *ci) {
static int getcurrentline (CallInfo *ci) {
return luaG_getfuncline(ci_func(ci)->p, currentpc(ci));
}
@@ -339,7 +339,7 @@ static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar,
break;
}
case 'l': {
ar->currentline = (ci && isLua(ci)) ? currentline(ci) : -1;
ar->currentline = (ci && isLua(ci)) ? getcurrentline(ci) : -1;
break;
}
case 'u': {
@@ -775,7 +775,7 @@ l_noret luaG_runerror (lua_State *L, const char *fmt, ...) {
msg = luaO_pushvfstring(L, fmt, argp); /* format message */
va_end(argp);
if (isLua(ci)) /* if Lua function, add source:line information */
luaG_addinfo(L, msg, ci_func(ci)->p->source, currentline(ci));
luaG_addinfo(L, msg, ci_func(ci)->p->source, getcurrentline(ci));
luaG_errormsg(L);
}