diff options
Diffstat (limited to 'lpprint.c')
-rw-r--r-- | lpprint.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lpprint.c,v 1.7 2013/04/12 16:29:49 roberto Exp $ | 2 | ** $Id: lpprint.c,v 1.9 2015/06/15 16:09:57 roberto Exp $ |
3 | ** Copyright 2007, Lua.org & PUC-Rio (see 'lpeg.html' for license) | 3 | ** Copyright 2007, Lua.org & PUC-Rio (see 'lpeg.html' for license) |
4 | */ | 4 | */ |
5 | 5 | ||
@@ -52,7 +52,7 @@ static void printjmp (const Instruction *op, const Instruction *p) { | |||
52 | } | 52 | } |
53 | 53 | ||
54 | 54 | ||
55 | static void printinst (const Instruction *op, const Instruction *p) { | 55 | void printinst (const Instruction *op, const Instruction *p) { |
56 | const char *const names[] = { | 56 | const char *const names[] = { |
57 | "any", "char", "set", | 57 | "any", "char", "set", |
58 | "testany", "testchar", "testset", | 58 | "testany", "testchar", "testset", |
@@ -239,10 +239,10 @@ void printtree (TTree *tree, int ident) { | |||
239 | 239 | ||
240 | void printktable (lua_State *L, int idx) { | 240 | void printktable (lua_State *L, int idx) { |
241 | int n, i; | 241 | int n, i; |
242 | lua_getfenv(L, idx); | 242 | lua_getuservalue(L, idx); |
243 | if (lua_isnil(L, -1)) /* no ktable? */ | 243 | if (lua_isnil(L, -1)) /* no ktable? */ |
244 | return; | 244 | return; |
245 | n = lua_objlen(L, -1); | 245 | n = lua_rawlen(L, -1); |
246 | printf("["); | 246 | printf("["); |
247 | for (i = 1; i <= n; i++) { | 247 | for (i = 1; i <= n; i++) { |
248 | printf("%d = ", i); | 248 | printf("%d = ", i); |