1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-13 11:40:29 +00:00

Move Bit32 library to LuaJ sources

This commit is contained in:
SquidDev 2017-06-28 23:05:48 +01:00
parent 084bbe8480
commit 6fca136327
3 changed files with 4 additions and 9 deletions

Binary file not shown.

View File

@ -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 class LuaJBit32Lib extends ZeroArgFunction
public static final class Bit32LibV extends VarArgFunction
{
@Override
public Varargs invoke( Varargs args )
{
switch( opcode )
@ -126,7 +121,6 @@ public class LuaJBit32Lib extends ZeroArgFunction
public static final class Bit32Lib2 extends TwoArgFunction
{
@Override
public LuaValue call( LuaValue arg1, LuaValue arg2 )
{
switch( opcode )

View File

@ -17,6 +17,7 @@ import dan200.computercraft.core.computer.ITask;
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 class LuaJLuaMachine implements ILuaMachine
// 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");