diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-05-13 10:10:04 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-05-13 10:10:04 -0300 |
| commit | c18fe57e543dabb828ad64dc2d45d66fa0fae429 (patch) | |
| tree | fc2d7a417037fcb4fd8e8e1a0d3dbdb1221e0e66 | |
| parent | af19d556355b6e79296811cb18fe511f8784b8f1 (diff) | |
| download | lua-c18fe57e543dabb828ad64dc2d45d66fa0fae429.tar.gz lua-c18fe57e543dabb828ad64dc2d45d66fa0fae429.tar.bz2 lua-c18fe57e543dabb828ad64dc2d45d66fa0fae429.zip | |
quick-and-dirty function to print code (for debugging Lua)
| -rw-r--r-- | ltests.c | 14 |
1 files changed, 13 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltests.c,v 1.119 2002/05/02 13:06:20 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 1.120 2002/05/06 19:05:10 roberto Exp roberto $ |
| 3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -162,6 +162,18 @@ static char *buildop (Proto *p, int pc, char *buff) { | |||
| 162 | } | 162 | } |
| 163 | 163 | ||
| 164 | 164 | ||
| 165 | #if 0 | ||
| 166 | void luaI_printcode (Proto *pt, int size) { | ||
| 167 | int pc; | ||
| 168 | for (pc=0; pc<size; pc++) { | ||
| 169 | char buff[100]; | ||
| 170 | printf("%s\n", buildop(pt, pc, buff)); | ||
| 171 | } | ||
| 172 | printf("-------\n"); | ||
| 173 | } | ||
| 174 | #endif | ||
| 175 | |||
| 176 | |||
| 165 | static int listcode (lua_State *L) { | 177 | static int listcode (lua_State *L) { |
| 166 | int pc; | 178 | int pc; |
| 167 | Proto *p; | 179 | Proto *p; |
