diff --git a/src/core/org/luaj/vm2/Lua.java b/src/core/org/luaj/vm2/Lua.java index 9b9b0ce1..48452fe5 100644 --- a/src/core/org/luaj/vm2/Lua.java +++ b/src/core/org/luaj/vm2/Lua.java @@ -23,10 +23,10 @@ package org.luaj.vm2; /** - * Constants for lua limits and opcodes. + * Constants for lua limits and opcodes. *

* This is a direct translation of C lua distribution header file constants - * for bytecode creation and processing. + * for bytecode creation and processing. */ public class Lua { /** version is supplied by ant build task */ @@ -80,7 +80,6 @@ public class Lua { public static final int POS_Bx = POS_C; public static final int POS_Ax = POS_A; - public static final int MAX_OP = ((1<>1); /* `sBx' is signed */ public static final int MAXARG_Ax = ((1< C) then pc++ */ - public static final int OP_TESTSET = 28; /* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */ + public static final int OP_TEST = 27; /* A C if not (R(A) <=> C) then pc++ */ + public static final int OP_TESTSET = 28; /* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */ public static final int OP_CALL = 29; /* A B C R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */ public static final int OP_TAILCALL = 30; /* A B C return R(A)(R(A+1), ... ,R(A+B-1)) */ @@ -225,7 +225,7 @@ public class Lua { public static final int OP_FORPREP = 33; /* A sBx R(A)-=R(A+2); pc+=sBx */ public static final int OP_TFORCALL = 34; /* A C R(A+3), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2)); */ - public static final int OP_TFORLOOP = 35; /* A sBx if R(A+1) ~= nil then { R(A)=R(A+1); pc += sBx } */ + public static final int OP_TFORLOOP = 35; /* A sBx if R(A+1) ~= nil then { R(A)=R(A+1); pc += sBx } */ public static final int OP_SETLIST = 36; /* A B C R(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B */ public static final int OP_CLOSURE = 37; /* A Bx R(A) := closure(KPROTO[Bx], R(A), ... ,R(A+n)) */ @@ -237,11 +237,11 @@ public class Lua { public static final int NUM_OPCODES = OP_EXTRAARG + 1; /* pseudo-opcodes used in parsing only. */ - public static final int OP_GT = 63; // > + public static final int OP_GT = 63; // > public static final int OP_GE = 62; // >= - public static final int OP_NEQ = 61; // ~= - public static final int OP_AND = 60; // and - public static final int OP_OR = 59; // or + public static final int OP_NEQ = 61; // ~= + public static final int OP_AND = 60; // and + public static final int OP_OR = 59; // or /*=========================================================================== Notes: @@ -271,7 +271,7 @@ public class Lua { ** bits 4-5: B arg mode ** bit 6: instruction set register A ** bit 7: operator is a test - */ + */ public static final int OpArgN = 0; /* argument is not used */ public static final int OpArgU = 1; /* argument is used */ @@ -353,7 +353,7 @@ public class Lua { source = "[string \""+source; end = "\"]"; } - int n = source.length() + end.length(); + int n = source.length() + end.length(); if ( n > MAXSRC ) source = source.substring(0,MAXSRC-end.length()-3) + "..."; return source + end; diff --git a/src/core/org/luaj/vm2/LuaClosure.java b/src/core/org/luaj/vm2/LuaClosure.java index 76534c15..8aae7eea 100644 --- a/src/core/org/luaj/vm2/LuaClosure.java +++ b/src/core/org/luaj/vm2/LuaClosure.java @@ -22,22 +22,22 @@ package org.luaj.vm2; /** - * Extension of {@link LuaFunction} which executes lua bytecode. + * Extension of {@link LuaFunction} which executes lua bytecode. *

- * A {@link LuaClosure} is a combination of a {@link Prototype} + * A {@link LuaClosure} is a combination of a {@link Prototype} * and a {@link LuaValue} to use as an environment for execution. * Normally the {@link LuaValue} is a {@link Globals} in which case the environment - * will contain standard lua libraries. + * will contain standard lua libraries. * *

* There are three main ways {@link LuaClosure} instances are created: - *