From c4791e2e3e5e2deb142a88f13ff09009940c34f9 Mon Sep 17 00:00:00 2001 From: James Roseborough Date: Tue, 4 Sep 2012 16:29:12 +0000 Subject: [PATCH] Lua 5.2 compatibility fixes. --- src/core/org/luaj/vm2/compiler/FuncState.java | 5 ++--- src/core/org/luaj/vm2/compiler/LexState.java | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/core/org/luaj/vm2/compiler/FuncState.java b/src/core/org/luaj/vm2/compiler/FuncState.java index 201c8169..e5eb8dcb 100644 --- a/src/core/org/luaj/vm2/compiler/FuncState.java +++ b/src/core/org/luaj/vm2/compiler/FuncState.java @@ -279,8 +279,8 @@ public class FuncState extends LuaC { // ============================================================= void nil(int from, int n) { - final int code_prev = f.code[pc - 1]; - if (pc > 0 && GET_OPCODE(code_prev) == OP_LOADNIL) { + if (pc > 0 && GET_OPCODE(f.code[pc - 1]) == OP_LOADNIL) { + final int code_prev = f.code[pc - 1]; int l = from + n - 1; /* last register to set nil */ int pfrom = GETARG_A(code_prev); int pl = pfrom + GETARG_B(code_prev); @@ -537,7 +537,6 @@ public class FuncState extends LuaC { } void dischargevars(expdesc e) { - System.out.println(" discharg vars e.k " + e.k); switch (e.k) { case LexState.VLOCAL: { e.k = LexState.VNONRELOC; diff --git a/src/core/org/luaj/vm2/compiler/LexState.java b/src/core/org/luaj/vm2/compiler/LexState.java index 8e3d3478..dc846e96 100644 --- a/src/core/org/luaj/vm2/compiler/LexState.java +++ b/src/core/org/luaj/vm2/compiler/LexState.java @@ -699,7 +699,6 @@ public class LexState { lookahead.token = TK_EOS; /* and discharge it */ } else t.token = llex(t.seminfo); /* read next token */ - System.out.println("---- next t.token " + t.token + " (" + txtToken(t.token) + ") " + linenumber ); } void lookahead() {