Permalink
Browse files

Move Bit32 library to LuaJ sources

  • Loading branch information...
SquidDev committed Jun 28, 2017
1 parent 084bbe8 commit 6fca136327e25ec3dac9d5906a856ae75189be88
View
BIN +2.4 KB (100%) libs/luaj-jse-2.0.3.jar
Binary file not shown.
@@ -19,22 +19,18 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
******************************************************************************/
package dan200.computercraft.core.lua;
package org.luaj.vm2.lib;
import org.luaj.vm2.LuaInteger;
import org.luaj.vm2.LuaTable;
import org.luaj.vm2.LuaValue;
import org.luaj.vm2.Varargs;
import org.luaj.vm2.lib.TwoArgFunction;
import org.luaj.vm2.lib.VarArgFunction;
import org.luaj.vm2.lib.ZeroArgFunction;
/**
* Subclass of LibFunction that implements the Lua standard {@code bit32} library.
*/
public class LuaJBit32Lib extends ZeroArgFunction
public class Bit32Lib extends ZeroArgFunction
{
@Override
public LuaValue call( )
{
LuaTable t = new LuaTable();
@@ -50,7 +46,6 @@ public LuaValue call( )
public static final class Bit32LibV extends VarArgFunction
{
@Override
public Varargs invoke( Varargs args )
{
switch( opcode )
@@ -126,7 +121,6 @@ public Varargs invoke( Varargs args )
public static final class Bit32Lib2 extends TwoArgFunction
{
@Override
public LuaValue call( LuaValue arg1, LuaValue arg2 )
{
switch( opcode )
@@ -17,6 +17,7 @@
import dan200.computercraft.core.computer.MainThread;
import org.luaj.vm2.*;
import org.luaj.vm2.lib.Bit32Lib;
import org.luaj.vm2.lib.OneArgFunction;
import org.luaj.vm2.lib.VarArgFunction;
import org.luaj.vm2.lib.ZeroArgFunction;
@@ -54,7 +55,7 @@ public LuaJLuaMachine( Computer computer )
// Create an environment to run in
m_globals = JsePlatform.debugGlobals();
m_globals.load( new LuaJBit32Lib() );
m_globals.load( new Bit32Lib() );
m_loadString = m_globals.get("loadstring");
m_assert = m_globals.get("assert");

0 comments on commit 6fca136

Please sign in to comment.