lua

A copy of the Lua development repository
Log | Files | Refs | README

commit ca181f31e41bbff8039aee3977894df7f9b128cb
parent 38b0e6128da7796300e2e8621e87835e16539f5b
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Tue,  5 Feb 2002 20:39:43 -0200

line number in listcode (and tests for replace)

Diffstat:
Mltests.c | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ltests.c b/ltests.c @@ -142,7 +142,8 @@ static char *buildop (Proto *p, int pc, char *buff) { Instruction i = p->code[pc]; OpCode o = GET_OPCODE(i); const char *name = luaP_opnames[o]; - sprintf(buff, "%4d - ", pc); + int line = luaG_getline(p->lineinfo, pc, 1, NULL); + sprintf(buff, "(%4d) %4d - ", line, pc); switch (getOpMode(o)) { case iABC: sprintf(buff+strlen(buff), "%-12s%4d %4d %4d", name, @@ -575,6 +576,9 @@ static int testC (lua_State *L) { else if EQ("insert") { lua_insert(L, getnum); } + else if EQ("replace") { + lua_replace(L, getnum); + } else if EQ("gettable") { lua_gettable(L, getnum); }