diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-02-05 20:40:05 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-02-05 20:40:05 -0200 |
| commit | ca181f31e41bbff8039aee3977894df7f9b128cb (patch) | |
| tree | 418b1efd2b1110da45f5bf522d35b7379319caee | |
| parent | 38b0e6128da7796300e2e8621e87835e16539f5b (diff) | |
| download | lua-ca181f31e41bbff8039aee3977894df7f9b128cb.tar.gz lua-ca181f31e41bbff8039aee3977894df7f9b128cb.tar.bz2 lua-ca181f31e41bbff8039aee3977894df7f9b128cb.zip | |
line number in listcode (and tests for replace)
Diffstat (limited to '')
| -rw-r--r-- | ltests.c | 6 |
1 files changed, 5 insertions, 1 deletions
| @@ -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 | } |
