| 728 | |
| 729 | |
| 730 | static int listcode (lua_State *L) { |
| 731 | int pc; |
| 732 | Proto *p; |
| 733 | luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), |
| 734 | 1, "Lua function expected"); |
| 735 | p = getproto(obj_at(L, 1)); |
| 736 | lua_newtable(L); |
| 737 | setnameval(L, "maxstack", p->maxstacksize); |
| 738 | setnameval(L, "numparams", p->numparams); |
| 739 | for (pc=0; pc<p->sizecode; pc++) { |
| 740 | char buff[100]; |
| 741 | lua_pushinteger(L, pc+1); |
| 742 | lua_pushstring(L, buildop(p, pc, buff)); |
| 743 | lua_settable(L, -3); |
| 744 | } |
| 745 | return 1; |
| 746 | } |
| 747 | |
| 748 | |
| 749 | static int printcode (lua_State *L) { |
nothing calls this directly
no test coverage detected