mirror of https://github.com/rusefi/lua.git
line number in listcode (and tests for replace)
This commit is contained in:
parent
38b0e6128d
commit
ca181f31e4
6
ltests.c
6
ltests.c
|
@ -142,7 +142,8 @@ static char *buildop (Proto *p, int pc, char *buff) {
|
||||||
Instruction i = p->code[pc];
|
Instruction i = p->code[pc];
|
||||||
OpCode o = GET_OPCODE(i);
|
OpCode o = GET_OPCODE(i);
|
||||||
const char *name = luaP_opnames[o];
|
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)) {
|
switch (getOpMode(o)) {
|
||||||
case iABC:
|
case iABC:
|
||||||
sprintf(buff+strlen(buff), "%-12s%4d %4d %4d", name,
|
sprintf(buff+strlen(buff), "%-12s%4d %4d %4d", name,
|
||||||
|
@ -575,6 +576,9 @@ static int testC (lua_State *L) {
|
||||||
else if EQ("insert") {
|
else if EQ("insert") {
|
||||||
lua_insert(L, getnum);
|
lua_insert(L, getnum);
|
||||||
}
|
}
|
||||||
|
else if EQ("replace") {
|
||||||
|
lua_replace(L, getnum);
|
||||||
|
}
|
||||||
else if EQ("gettable") {
|
else if EQ("gettable") {
|
||||||
lua_gettable(L, getnum);
|
lua_gettable(L, getnum);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue