aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-02-05 20:40:05 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-02-05 20:40:05 -0200
commitca181f31e41bbff8039aee3977894df7f9b128cb (patch)
tree418b1efd2b1110da45f5bf522d35b7379319caee
parent38b0e6128da7796300e2e8621e87835e16539f5b (diff)
downloadlua-ca181f31e41bbff8039aee3977894df7f9b128cb.tar.gz
lua-ca181f31e41bbff8039aee3977894df7f9b128cb.tar.bz2
lua-ca181f31e41bbff8039aee3977894df7f9b128cb.zip
line number in listcode (and tests for replace)
-rw-r--r--ltests.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ltests.c b/ltests.c
index f7c0638a..ea61c741 100644
--- a/ltests.c
+++ b/ltests.c
@@ -142,7 +142,8 @@ static char *buildop (Proto *p, int pc, char *buff) {
142 Instruction i = p->code[pc]; 142 Instruction i = p->code[pc];
143 OpCode o = GET_OPCODE(i); 143 OpCode o = GET_OPCODE(i);
144 const char *name = luaP_opnames[o]; 144 const char *name = luaP_opnames[o];
145 sprintf(buff, "%4d - ", pc); 145 int line = luaG_getline(p->lineinfo, pc, 1, NULL);
146 sprintf(buff, "(%4d) %4d - ", line, pc);
146 switch (getOpMode(o)) { 147 switch (getOpMode(o)) {
147 case iABC: 148 case iABC:
148 sprintf(buff+strlen(buff), "%-12s%4d %4d %4d", name, 149 sprintf(buff+strlen(buff), "%-12s%4d %4d %4d", name,
@@ -575,6 +576,9 @@ static int testC (lua_State *L) {
575 else if EQ("insert") { 576 else if EQ("insert") {
576 lua_insert(L, getnum); 577 lua_insert(L, getnum);
577 } 578 }
579 else if EQ("replace") {
580 lua_replace(L, getnum);
581 }
578 else if EQ("gettable") { 582 else if EQ("gettable") {
579 lua_gettable(L, getnum); 583 lua_gettable(L, getnum);
580 } 584 }