Added missed Classes
This commit is contained in:
18
README.md
18
README.md
@@ -254,7 +254,7 @@ A simple hello, world example in luaj is:
|
||||
|
||||
<pre>
|
||||
import org.luaj.vm2.*;
|
||||
import org.luaj.vm2.lib.jse.*;
|
||||
import org.luaj.vm2.libs.jse.*;
|
||||
|
||||
Globals globals = JsePlatform.standardGlobals();
|
||||
LuaValue chunk = globals.load("print 'hello, world'");
|
||||
@@ -296,7 +296,7 @@ For MIDlets the <em>JmePlatform</em> is used instead:
|
||||
|
||||
<pre>
|
||||
import org.luaj.vm2.*;
|
||||
import org.luaj.vm2.lib.jme.*;
|
||||
import org.luaj.vm2.libs.jme.*;
|
||||
|
||||
Globals globals = JmePlatform.standardGlobals();
|
||||
LuaValue chunk = globals.loadfile("examples/lua/hello.lua");
|
||||
@@ -566,7 +566,7 @@ create globals that contain the debug library in addition to the other standard
|
||||
|
||||
To install dynamically from lua use java-class-based require:</em>:
|
||||
<pre>
|
||||
require 'org.luaj.vm2.lib.DebugLib'
|
||||
require 'org.luaj.vm2.libs.DebugLib'
|
||||
</pre>
|
||||
|
||||
The <em>lua</em> command line utility includes the <em>debug</em> library by default.
|
||||
@@ -666,11 +666,11 @@ The simplest way to implement a function is to choose a base class based on the
|
||||
LuaJ provides 5 base classes for this purpose, depending if the function has 0, 1, 2, 3 or variable arguments,
|
||||
and if it provide multiple return values.
|
||||
<pre>
|
||||
<a href="http://luaj.org/luaj/3.0/api/org/luaj/vm2/lib/ZeroArgFunction.html">org.luaj.vm2.lib.ZeroArgFunction</a>
|
||||
<a href="http://luaj.org/luaj/3.0/api/org/luaj/vm2/lib/OneArgFunction.html">org.luaj.vm2.lib.OneArgFunction</a>
|
||||
<a href="http://luaj.org/luaj/3.0/api/org/luaj/vm2/lib/TwoArgFunction.html">org.luaj.vm2.lib.TwoArgFunction</a>
|
||||
<a href="http://luaj.org/luaj/3.0/api/org/luaj/vm2/lib/ThreeArgFunction.html">org.luaj.vm2.lib.ThreeArgFunction</a>
|
||||
<a href="http://luaj.org/luaj/3.0/api/org/luaj/vm2/lib/VarArgFunction.html">org.luaj.vm2.lib.VarArgFunction</a>
|
||||
<a href="http://luaj.org/luaj/3.0/api/org/luaj/vm2/lib/ZeroArgFunction.html">org.luaj.vm2.libs.ZeroArgFunction</a>
|
||||
<a href="http://luaj.org/luaj/3.0/api/org/luaj/vm2/lib/OneArgFunction.html">org.luaj.vm2.libs.OneArgFunction</a>
|
||||
<a href="http://luaj.org/luaj/3.0/api/org/luaj/vm2/lib/TwoArgFunction.html">org.luaj.vm2.libs.TwoArgFunction</a>
|
||||
<a href="http://luaj.org/luaj/3.0/api/org/luaj/vm2/lib/ThreeArgFunction.html">org.luaj.vm2.libs.ThreeArgFunction</a>
|
||||
<a href="http://luaj.org/luaj/3.0/api/org/luaj/vm2/lib/VarArgFunction.html">org.luaj.vm2.libs.VarArgFunction</a>
|
||||
</pre>
|
||||
|
||||
Each of these functions has an abstract method that must be implemented,
|
||||
@@ -724,7 +724,7 @@ in the environment that can be called from lua.
|
||||
A complete example of Java code for a simple toy library is in <a href="examples/jse/hyperbolic.java">examples/jse/hyperbolic.java</a>
|
||||
<pre>
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.lib.*;
|
||||
import org.luaj.vm2.libs.*;
|
||||
|
||||
public class hyperbolic extends TwoArgFunction {
|
||||
|
||||
|
||||
@@ -26,11 +26,11 @@ import java.io.InputStream;
|
||||
import java.io.PrintStream;
|
||||
import java.io.Reader;
|
||||
|
||||
import org.luaj.vm2.lib.BaseLib;
|
||||
import org.luaj.vm2.lib.DebugLib;
|
||||
import org.luaj.vm2.lib.IoLib;
|
||||
import org.luaj.vm2.lib.PackageLib;
|
||||
import org.luaj.vm2.lib.ResourceFinder;
|
||||
import org.luaj.vm2.libs.BaseLib;
|
||||
import org.luaj.vm2.libs.DebugLib;
|
||||
import org.luaj.vm2.libs.IoLib;
|
||||
import org.luaj.vm2.libs.PackageLib;
|
||||
import org.luaj.vm2.libs.ResourceFinder;
|
||||
|
||||
/**
|
||||
* Global environment used by luaj. Contains global variables referenced by executing lua.
|
||||
@@ -38,8 +38,8 @@ import org.luaj.vm2.lib.ResourceFinder;
|
||||
*
|
||||
* <h3>Constructing and Initializing Instances</h3>
|
||||
* Typically, this is constructed indirectly by a call to
|
||||
* {@link org.luaj.vm2.lib.jse.JsePlatform#standardGlobals()} or
|
||||
* {@link org.luaj.vm2.lib.jme.JmePlatform#standardGlobals()},
|
||||
* {@link org.luaj.vm2.libs.jse.JsePlatform#standardGlobals()} or
|
||||
* {@link org.luaj.vm2.libs.jme.JmePlatform#standardGlobals()},
|
||||
* and then used to load lua scripts for execution as in the following example.
|
||||
* <pre> {@code
|
||||
* Globals globals = JsePlatform.standardGlobals();
|
||||
@@ -89,7 +89,7 @@ import org.luaj.vm2.lib.ResourceFinder;
|
||||
* </ul>
|
||||
*
|
||||
* <h3>Lua Environment Variables</h3>
|
||||
* When using {@link org.luaj.vm2.lib.jse.JsePlatform} or {@link org.luaj.vm2.lib.jme.JmePlatform},
|
||||
* When using {@link org.luaj.vm2.libs.jse.JsePlatform} or {@link org.luaj.vm2.libs.jme.JmePlatform},
|
||||
* these environment variables are created within the Globals.
|
||||
* <ul>
|
||||
* <li>"_G" Pointer to this Globals.
|
||||
@@ -102,8 +102,8 @@ import org.luaj.vm2.lib.ResourceFinder;
|
||||
* static immutable resources such as class data and string data.
|
||||
* <p>
|
||||
*
|
||||
* @see org.luaj.vm2.lib.jse.JsePlatform
|
||||
* @see org.luaj.vm2.lib.jme.JmePlatform
|
||||
* @see org.luaj.vm2.libs.jse.JsePlatform
|
||||
* @see org.luaj.vm2.libs.jme.JmePlatform
|
||||
* @see LuaValue
|
||||
* @see Compiler
|
||||
* @see Loader
|
||||
|
||||
@@ -44,8 +44,8 @@ import java.io.InputStream;
|
||||
* This should work regardless of which {@link Globals.Compiler} or {@link Globals.Undumper}
|
||||
* have been installed.
|
||||
* <p>
|
||||
* By default, when using {@link org.luaj.vm2.lib.jse.JsePlatform} or
|
||||
* {@link org.luaj.vm2.lib.jme.JmePlatform}
|
||||
* By default, when using {@link org.luaj.vm2.libs.jse.JsePlatform} or
|
||||
* {@link org.luaj.vm2.libs.jme.JmePlatform}
|
||||
* to construct globals, the {@link LoadState} default undumper is installed
|
||||
* as the default {@link Globals.Undumper}.
|
||||
* <p>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
package org.luaj.vm2;
|
||||
|
||||
import org.luaj.vm2.lib.DebugLib.CallFrame;
|
||||
import org.luaj.vm2.libs.DebugLib.CallFrame;
|
||||
|
||||
/**
|
||||
* Extension of {@link LuaFunction} which executes lua bytecode.
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
package org.luaj.vm2;
|
||||
|
||||
import org.luaj.vm2.lib.MathLib;
|
||||
import org.luaj.vm2.libs.MathLib;
|
||||
|
||||
/**
|
||||
* Extension of {@link LuaNumber} which can hold a Java double as its value.
|
||||
|
||||
@@ -25,14 +25,14 @@ package org.luaj.vm2;
|
||||
/**
|
||||
* Base class for functions implemented in Java.
|
||||
* <p>
|
||||
* Direct subclass include {@link org.luaj.vm2.lib.LibFunction}
|
||||
* Direct subclass include {@link org.luaj.vm2.libs.LibFunction}
|
||||
* which is the base class for
|
||||
* all built-in library functions coded in Java,
|
||||
* and {@link LuaClosure}, which represents a lua closure
|
||||
* whose bytecode is interpreted when the function is invoked.
|
||||
* @see LuaValue
|
||||
* @see LuaClosure
|
||||
* @see org.luaj.vm2.lib.LibFunction
|
||||
* @see org.luaj.vm2.libs.LibFunction
|
||||
*/
|
||||
abstract
|
||||
public class LuaFunction extends LuaValue {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
package org.luaj.vm2;
|
||||
|
||||
import org.luaj.vm2.lib.MathLib;
|
||||
import org.luaj.vm2.libs.MathLib;
|
||||
|
||||
/**
|
||||
* Extension of {@link LuaNumber} which can hold a Java int as its value.
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.PrintStream;
|
||||
|
||||
import org.luaj.vm2.lib.MathLib;
|
||||
import org.luaj.vm2.libs.MathLib;
|
||||
|
||||
/**
|
||||
* Subclass of {@link LuaValue} for representing lua strings.
|
||||
|
||||
@@ -40,8 +40,8 @@ import java.util.concurrent.locks.ReentrantLock;
|
||||
* This is done via the constructor arguments {@link #LuaThread(Globals)} or
|
||||
* {@link #LuaThread(Globals, LuaValue)}.
|
||||
* <p>
|
||||
* The utility classes {@link org.luaj.vm2.lib.jse.JsePlatform} and
|
||||
* {@link org.luaj.vm2.lib.jme.JmePlatform}
|
||||
* The utility classes {@link org.luaj.vm2.libs.jse.JsePlatform} and
|
||||
* {@link org.luaj.vm2.libs.jme.JmePlatform}
|
||||
* see to it that this {@link Globals} are initialized properly.
|
||||
* <p>
|
||||
* The behavior of coroutine threads matches closely the behavior
|
||||
@@ -65,9 +65,9 @@ import java.util.concurrent.locks.ReentrantLock;
|
||||
*
|
||||
*
|
||||
* @see LuaValue
|
||||
* @see org.luaj.vm2.lib.jse.JsePlatform
|
||||
* @see org.luaj.vm2.lib.jme.JmePlatform
|
||||
* @see org.luaj.vm2.lib.CoroutineLib
|
||||
* @see org.luaj.vm2.libs.jse.JsePlatform
|
||||
* @see org.luaj.vm2.libs.jme.JmePlatform
|
||||
* @see org.luaj.vm2.libs.CoroutineLib
|
||||
*/
|
||||
public class LuaThread extends LuaValue {
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ package org.luaj.vm2;
|
||||
* } </pre>
|
||||
* For this to work the file must be in the current directory, or in the class path,
|
||||
* dependening on the platform.
|
||||
* See {@link org.luaj.vm2.lib.jse.JsePlatform} and {@link org.luaj.vm2.lib.jme.JmePlatform} for details.
|
||||
* See {@link org.luaj.vm2.libs.jse.JsePlatform} and {@link org.luaj.vm2.libs.jme.JmePlatform} for details.
|
||||
* <p>
|
||||
* In general a {@link LuaError} may be thrown on any operation when the
|
||||
* types supplied to any operation are illegal from a lua perspective.
|
||||
@@ -101,8 +101,8 @@ package org.luaj.vm2;
|
||||
* {@link #MOD}, {@link #UNM}, {@link #LEN}, {@link #EQ}, {@link #LT},
|
||||
* {@link #LE}, {@link #TOSTRING}, and {@link #CONCAT}.
|
||||
*
|
||||
* @see org.luaj.vm2.lib.jse.JsePlatform
|
||||
* @see org.luaj.vm2.lib.jme.JmePlatform
|
||||
* @see org.luaj.vm2.libs.jse.JsePlatform
|
||||
* @see org.luaj.vm2.libs.jme.JmePlatform
|
||||
* @see LoadState
|
||||
* @see Varargs
|
||||
*/
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.luaj.vm2.LuaString;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.Prototype;
|
||||
import org.luaj.vm2.compiler.FuncState.BlockCnt;
|
||||
import org.luaj.vm2.lib.MathLib;
|
||||
import org.luaj.vm2.libs.MathLib;
|
||||
|
||||
|
||||
public class LexState extends Constants {
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.luaj.vm2.LuaFunction;
|
||||
import org.luaj.vm2.LuaString;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.Prototype;
|
||||
import org.luaj.vm2.lib.BaseLib;
|
||||
import org.luaj.vm2.libs.BaseLib;
|
||||
|
||||
/**
|
||||
* Compiler for Lua.
|
||||
@@ -49,7 +49,7 @@ import org.luaj.vm2.lib.BaseLib;
|
||||
*
|
||||
* <p>
|
||||
* The {@link LuaC} compiler is installed by default by both the
|
||||
* {@link org.luaj.vm2.lib.jse.JsePlatform} and {@link org.luaj.vm2.lib.jme.JmePlatform} classes,
|
||||
* {@link org.luaj.vm2.libs.jse.JsePlatform} and {@link org.luaj.vm2.libs.jme.JmePlatform} classes,
|
||||
* so in the following example, the default {@link LuaC} compiler
|
||||
* will be used:
|
||||
* <pre> {@code
|
||||
@@ -66,8 +66,8 @@ import org.luaj.vm2.lib.BaseLib;
|
||||
* @see Globals#compiler
|
||||
* @see Globals#loader
|
||||
* @see org.luaj.vm2.luajc.LuaJC
|
||||
* @see org.luaj.vm2.lib.jse.JsePlatform
|
||||
* @see org.luaj.vm2.lib.jme.JmePlatform
|
||||
* @see org.luaj.vm2.libs.jse.JsePlatform
|
||||
* @see org.luaj.vm2.libs.jme.JmePlatform
|
||||
* @see BaseLib
|
||||
* @see LuaValue
|
||||
* @see Prototype
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.luaj.vm2.android;
|
||||
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.lib.jse.CoerceJavaToLua;
|
||||
import org.luaj.vm2.libs.jse.CoerceJavaToLua;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -4,9 +4,9 @@ import java.io.InputStream;
|
||||
|
||||
import org.luaj.vm2.Globals;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.lib.ResourceFinder;
|
||||
import org.luaj.vm2.lib.jse.CoerceJavaToLua;
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.ResourceFinder;
|
||||
import org.luaj.vm2.libs.jse.CoerceJavaToLua;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
|
||||
@@ -4,7 +4,7 @@ import javax.microedition.midlet.MIDlet;
|
||||
import javax.microedition.midlet.MIDletStateChangeException;
|
||||
|
||||
import org.luaj.vm2.*;
|
||||
import org.luaj.vm2.lib.jme.JmePlatform;
|
||||
import org.luaj.vm2.libs.jme.JmePlatform;
|
||||
|
||||
|
||||
public class SampleMIDlet extends MIDlet {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import org.luaj.vm2.Globals;
|
||||
import org.luaj.vm2.LuaThread;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
|
||||
/** Example that continually launches coroutines, and illustrates how to make
|
||||
* sure the orphaned coroutines are cleaned up properly.
|
||||
|
||||
@@ -7,18 +7,18 @@ import org.luaj.vm2.Globals;
|
||||
import org.luaj.vm2.LoadState;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.compiler.LuaC;
|
||||
import org.luaj.vm2.lib.Bit32Lib;
|
||||
import org.luaj.vm2.lib.CoroutineLib;
|
||||
import org.luaj.vm2.lib.PackageLib;
|
||||
import org.luaj.vm2.lib.ResourceFinder;
|
||||
import org.luaj.vm2.lib.TableLib;
|
||||
import org.luaj.vm2.lib.jse.CoerceJavaToLua;
|
||||
import org.luaj.vm2.lib.jse.JseBaseLib;
|
||||
import org.luaj.vm2.lib.jse.JseIoLib;
|
||||
import org.luaj.vm2.lib.jse.JseMathLib;
|
||||
import org.luaj.vm2.lib.jse.JseOsLib;
|
||||
import org.luaj.vm2.lib.jse.JseStringLib;
|
||||
import org.luaj.vm2.lib.jse.LuajavaLib;
|
||||
import org.luaj.vm2.libs.Bit32Lib;
|
||||
import org.luaj.vm2.libs.CoroutineLib;
|
||||
import org.luaj.vm2.libs.PackageLib;
|
||||
import org.luaj.vm2.libs.ResourceFinder;
|
||||
import org.luaj.vm2.libs.TableLib;
|
||||
import org.luaj.vm2.libs.jse.CoerceJavaToLua;
|
||||
import org.luaj.vm2.libs.jse.JseBaseLib;
|
||||
import org.luaj.vm2.libs.jse.JseIoLib;
|
||||
import org.luaj.vm2.libs.jse.JseMathLib;
|
||||
import org.luaj.vm2.libs.jse.JseOsLib;
|
||||
import org.luaj.vm2.libs.jse.JseStringLib;
|
||||
import org.luaj.vm2.libs.jse.LuajavaLib;
|
||||
|
||||
/**
|
||||
* Simple Applet that forwards Applet lifecycle events to a lua script.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
import org.luaj.vm2.Globals;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
|
||||
/** Simple program showing the minimal Java program to launch a script.
|
||||
*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import java.io.IOException;
|
||||
|
||||
import org.luaj.vm2.Globals;
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
|
||||
/** Simple toy program illustrating how to run Luaj in multiple threads.
|
||||
*
|
||||
|
||||
@@ -7,15 +7,15 @@ import org.luaj.vm2.LuaThread;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.Varargs;
|
||||
import org.luaj.vm2.compiler.LuaC;
|
||||
import org.luaj.vm2.lib.Bit32Lib;
|
||||
import org.luaj.vm2.lib.DebugLib;
|
||||
import org.luaj.vm2.lib.PackageLib;
|
||||
import org.luaj.vm2.lib.TableLib;
|
||||
import org.luaj.vm2.lib.TwoArgFunction;
|
||||
import org.luaj.vm2.lib.ZeroArgFunction;
|
||||
import org.luaj.vm2.lib.jse.JseBaseLib;
|
||||
import org.luaj.vm2.lib.jse.JseMathLib;
|
||||
import org.luaj.vm2.lib.jse.JseStringLib;
|
||||
import org.luaj.vm2.libs.Bit32Lib;
|
||||
import org.luaj.vm2.libs.DebugLib;
|
||||
import org.luaj.vm2.libs.PackageLib;
|
||||
import org.luaj.vm2.libs.TableLib;
|
||||
import org.luaj.vm2.libs.TwoArgFunction;
|
||||
import org.luaj.vm2.libs.ZeroArgFunction;
|
||||
import org.luaj.vm2.libs.jse.JseBaseLib;
|
||||
import org.luaj.vm2.libs.jse.JseMathLib;
|
||||
import org.luaj.vm2.libs.jse.JseStringLib;
|
||||
|
||||
/** Simple program that illustrates basic sand-boxing of client scripts
|
||||
* in a server environment.
|
||||
|
||||
@@ -3,7 +3,7 @@ import java.io.Reader;
|
||||
|
||||
import org.luaj.vm2.Globals;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
import org.luaj.vm2.server.Launcher;
|
||||
import org.luaj.vm2.server.LuajClassLoader;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import javax.script.ScriptException;
|
||||
import javax.script.SimpleBindings;
|
||||
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.lib.OneArgFunction;
|
||||
import org.luaj.vm2.libs.OneArgFunction;
|
||||
|
||||
/** Sample code that uses the JSE-223 pluggable scripting language interface
|
||||
* to instantiate and use luaj.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.lib.OneArgFunction;
|
||||
import org.luaj.vm2.lib.TwoArgFunction;
|
||||
import org.luaj.vm2.libs.OneArgFunction;
|
||||
import org.luaj.vm2.libs.TwoArgFunction;
|
||||
|
||||
/**
|
||||
* Sample library that can be called via luaj's require() implementation.
|
||||
|
||||
@@ -2,7 +2,7 @@ package acme;
|
||||
|
||||
import org.luaj.vm2.Globals;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
|
||||
/**
|
||||
* Sample source file for a maven project that depends on luaj.
|
||||
|
||||
@@ -10,9 +10,7 @@ import junit.framework.TestSuite;
|
||||
|
||||
import org.luaj.vm2.Globals;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
|
||||
import acme.App;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
|
||||
/**
|
||||
* Skeleton unit test for App, required for maven to be used to build the app.
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
package org.openautonomousconnection.luaj;
|
||||
|
||||
//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
|
||||
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
|
||||
public class Main {
|
||||
static void main() {
|
||||
//TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text
|
||||
// to see how IntelliJ IDEA suggests fixing it.
|
||||
IO.println(String.format("Hello and welcome!"));
|
||||
|
||||
for (int i = 1; i <= 5; i++) {
|
||||
//TIP Press <shortcut actionId="Debug"/> to start debugging your code. We have set one <icon src="AllIcons.Debugger.Db_set_breakpoint"/> breakpoint
|
||||
// for you, but you can always add more by pressing <shortcut actionId="ToggleLineBreakpoint"/>.
|
||||
IO.println("i = " + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ import org.luaj.vm2.LuaTable;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.Print;
|
||||
import org.luaj.vm2.Varargs;
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
import org.luaj.vm2.luajc.LuaJC;
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.luaj.vm2.Lua;
|
||||
import org.luaj.vm2.Print;
|
||||
import org.luaj.vm2.Prototype;
|
||||
import org.luaj.vm2.compiler.DumpState;
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,7 +32,7 @@ import java.util.List;
|
||||
|
||||
import org.luaj.vm2.Globals;
|
||||
import org.luaj.vm2.Lua;
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
import org.luaj.vm2.luajc.LuaJC;
|
||||
|
||||
/**
|
||||
|
||||
@@ -60,11 +60,11 @@ import org.luaj.vm2.LuaTable;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.Prototype;
|
||||
import org.luaj.vm2.Varargs;
|
||||
import org.luaj.vm2.lib.OneArgFunction;
|
||||
import org.luaj.vm2.lib.ThreeArgFunction;
|
||||
import org.luaj.vm2.lib.TwoArgFunction;
|
||||
import org.luaj.vm2.lib.VarArgFunction;
|
||||
import org.luaj.vm2.lib.ZeroArgFunction;
|
||||
import org.luaj.vm2.libs.OneArgFunction;
|
||||
import org.luaj.vm2.libs.ThreeArgFunction;
|
||||
import org.luaj.vm2.libs.TwoArgFunction;
|
||||
import org.luaj.vm2.libs.VarArgFunction;
|
||||
import org.luaj.vm2.libs.ZeroArgFunction;
|
||||
|
||||
public class JavaBuilder {
|
||||
|
||||
|
||||
@@ -32,13 +32,14 @@ import org.luaj.vm2.LuaFunction;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.Prototype;
|
||||
import org.luaj.vm2.compiler.LuaC;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
|
||||
/**
|
||||
* Implementation of {@link Globals.Compiler} which does direct
|
||||
* lua-to-java-bytecode compiling.
|
||||
* <p>
|
||||
* By default, when using {@link org.luaj.vm2.lib.jse.JsePlatform} or
|
||||
* {@link org.luaj.vm2.lib.jme.JmePlatform}
|
||||
* By default, when using {@link JsePlatform} or
|
||||
* {@link org.luaj.vm2.libs.jme.JmePlatform}
|
||||
* to construct globals, the plain compiler {@link LuaC} is installed and lua code
|
||||
* will only be compiled into lua bytecode and execute as {@link LuaClosure}.
|
||||
* <p>
|
||||
|
||||
@@ -26,9 +26,9 @@ import java.io.*;
|
||||
import javax.script.*;
|
||||
|
||||
import org.luaj.vm2.*;
|
||||
import org.luaj.vm2.lib.ThreeArgFunction;
|
||||
import org.luaj.vm2.lib.TwoArgFunction;
|
||||
import org.luaj.vm2.lib.jse.CoerceJavaToLua;
|
||||
import org.luaj.vm2.libs.ThreeArgFunction;
|
||||
import org.luaj.vm2.libs.TwoArgFunction;
|
||||
import org.luaj.vm2.libs.jse.CoerceJavaToLua;
|
||||
|
||||
/**
|
||||
* Implementation of the ScriptEngine interface which can compile and execute
|
||||
|
||||
@@ -32,7 +32,7 @@ import javax.script.ScriptContext;
|
||||
import javax.script.SimpleScriptContext;
|
||||
|
||||
import org.luaj.vm2.Globals;
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
import org.luaj.vm2.luajc.LuaJC;
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,8 +27,8 @@ import java.io.Reader;
|
||||
import org.luaj.vm2.Globals;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.Varargs;
|
||||
import org.luaj.vm2.lib.jse.CoerceJavaToLua;
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.jse.CoerceJavaToLua;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
|
||||
/**
|
||||
* Default {@link Launcher} instance that creates standard globals
|
||||
|
||||
@@ -2,8 +2,8 @@ package org.luaj.luajc;
|
||||
|
||||
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.libs.TwoArgFunction;
|
||||
import org.luaj.vm2.libs.VarArgFunction;
|
||||
|
||||
public class SampleMainChunk extends VarArgFunction {
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.luaj.vm2.Globals;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.Print;
|
||||
import org.luaj.vm2.Prototype;
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
|
||||
/** Test the plain old bytecode interpreter */
|
||||
public class TestLuaJ {
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.Print;
|
||||
import org.luaj.vm2.Prototype;
|
||||
import org.luaj.vm2.Varargs;
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
import org.luaj.vm2.luajc.LuaJC;
|
||||
|
||||
public class TestLuaJC {
|
||||
|
||||
@@ -32,11 +32,11 @@ import org.luaj.vm2.compiler.DumpLoadEndianIntTest;
|
||||
import org.luaj.vm2.compiler.LuaParserTests;
|
||||
import org.luaj.vm2.compiler.RegressionTests;
|
||||
import org.luaj.vm2.compiler.SimpleTests;
|
||||
import org.luaj.vm2.lib.jse.JsePlatformTest;
|
||||
import org.luaj.vm2.lib.jse.LuaJavaCoercionTest;
|
||||
import org.luaj.vm2.lib.jse.LuajavaAccessibleMembersTest;
|
||||
import org.luaj.vm2.lib.jse.LuajavaClassMembersTest;
|
||||
import org.luaj.vm2.lib.jse.OsLibTest;
|
||||
import org.luaj.vm2.libs.jse.JsePlatformTest;
|
||||
import org.luaj.vm2.libs.jse.LuaJavaCoercionTest;
|
||||
import org.luaj.vm2.libs.jse.LuajavaAccessibleMembersTest;
|
||||
import org.luaj.vm2.libs.jse.LuajavaClassMembersTest;
|
||||
import org.luaj.vm2.libs.jse.OsLibTest;
|
||||
import org.luaj.vm2.script.ScriptEngineTests;
|
||||
|
||||
public class AllTests {
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.io.StringReader;
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
import org.luaj.vm2.luajc.LuaJC;
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.io.Reader;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
import org.luaj.vm2.server.Launcher;
|
||||
import org.luaj.vm2.server.LuajClassLoader;
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@ import java.lang.reflect.InvocationTargetException;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.luaj.vm2.TypeTest.MyData;
|
||||
import org.luaj.vm2.compiler.LuaC;
|
||||
import org.luaj.vm2.lib.ZeroArgFunction;
|
||||
import org.luaj.vm2.libs.ZeroArgFunction;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
|
||||
public class LuaOperationsTest extends TestCase {
|
||||
|
||||
@@ -130,7 +130,7 @@ public class LuaOperationsTest extends TestCase {
|
||||
|
||||
public Prototype createPrototype( String script, String name ) {
|
||||
try {
|
||||
Globals globals = org.luaj.vm2.lib.jse.JsePlatform.standardGlobals();
|
||||
Globals globals = JsePlatform.standardGlobals();
|
||||
Reader reader = new StringReader(script);
|
||||
return globals.compilePrototype(reader, name);
|
||||
} catch (Exception e) {
|
||||
@@ -146,7 +146,7 @@ public class LuaOperationsTest extends TestCase {
|
||||
// set up suitable environments for execution
|
||||
LuaValue aaa = LuaValue.valueOf("aaa");
|
||||
LuaValue eee = LuaValue.valueOf("eee");
|
||||
final Globals globals = org.luaj.vm2.lib.jse.JsePlatform.standardGlobals();
|
||||
final Globals globals = JsePlatform.standardGlobals();
|
||||
LuaTable newenv = LuaValue.tableOf( new LuaValue[] {
|
||||
LuaValue.valueOf("a"), LuaValue.valueOf("aaa"),
|
||||
LuaValue.valueOf("b"), LuaValue.valueOf("bbb"), } );
|
||||
|
||||
@@ -2,8 +2,8 @@ package org.luaj.vm2;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.luaj.vm2.lib.jme.JmePlatform;
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.jme.JmePlatform;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
|
||||
public class MathLibTest extends TestCase {
|
||||
|
||||
|
||||
@@ -24,10 +24,10 @@ package org.luaj.vm2;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.luaj.vm2.TypeTest.MyData;
|
||||
import org.luaj.vm2.lib.StringLib;
|
||||
import org.luaj.vm2.lib.ThreeArgFunction;
|
||||
import org.luaj.vm2.lib.TwoArgFunction;
|
||||
import org.luaj.vm2.lib.ZeroArgFunction;
|
||||
import org.luaj.vm2.libs.StringLib;
|
||||
import org.luaj.vm2.libs.ThreeArgFunction;
|
||||
import org.luaj.vm2.libs.TwoArgFunction;
|
||||
import org.luaj.vm2.libs.ZeroArgFunction;
|
||||
|
||||
public class MetatableTest extends TestCase {
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ import java.lang.ref.WeakReference;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.luaj.vm2.lib.OneArgFunction;
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.OneArgFunction;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
|
||||
|
||||
public class OrphanedThreadTest extends TestCase {
|
||||
|
||||
@@ -2,7 +2,7 @@ package org.luaj.vm2;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
import org.luaj.vm2.require.RequireSampleClassCastExcep;
|
||||
import org.luaj.vm2.require.RequireSampleLoadLuaError;
|
||||
import org.luaj.vm2.require.RequireSampleLoadRuntimeExcep;
|
||||
|
||||
@@ -34,8 +34,9 @@ import java.net.URL;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.luaj.vm2.lib.ResourceFinder;
|
||||
import org.luaj.vm2.lib.jse.JseProcess;
|
||||
import org.luaj.vm2.libs.ResourceFinder;
|
||||
import org.luaj.vm2.libs.jse.JseProcess;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
import org.luaj.vm2.luajc.LuaJC;
|
||||
|
||||
abstract
|
||||
@@ -64,10 +65,10 @@ public class ScriptDrivenTest extends TestCase implements ResourceFinder {
|
||||
default:
|
||||
case JSE:
|
||||
case LUAJIT:
|
||||
globals = org.luaj.vm2.lib.jse.JsePlatform.debugGlobals();
|
||||
globals = JsePlatform.debugGlobals();
|
||||
break;
|
||||
case JME:
|
||||
globals = org.luaj.vm2.lib.jme.JmePlatform.debugGlobals();
|
||||
globals = org.luaj.vm2.libs.jme.JmePlatform.debugGlobals();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.io.UnsupportedEncodingException;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
|
||||
public class StringTest extends TestCase {
|
||||
|
||||
|
||||
@@ -23,10 +23,7 @@ package org.luaj.vm2;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.luaj.vm2.LuaString;
|
||||
import org.luaj.vm2.LuaTable;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.lib.TwoArgFunction;
|
||||
import org.luaj.vm2.libs.TwoArgFunction;
|
||||
|
||||
/**
|
||||
* Tests for tables used as lists.
|
||||
|
||||
@@ -25,8 +25,8 @@ import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.luaj.vm2.lib.ZeroArgFunction;
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.ZeroArgFunction;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
|
||||
public class TypeTest extends TestCase {
|
||||
static {
|
||||
|
||||
@@ -23,7 +23,7 @@ package org.luaj.vm2;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
|
||||
public class UTF8StreamTest extends TestCase {
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.luaj.vm2.lib.TwoArgFunction;
|
||||
import org.luaj.vm2.libs.TwoArgFunction;
|
||||
|
||||
/**
|
||||
* Tests of basic unary and binary operators on main value types.
|
||||
|
||||
@@ -4,8 +4,7 @@ import junit.framework.TestCase;
|
||||
import org.luaj.vm2.Globals;
|
||||
import org.luaj.vm2.Print;
|
||||
import org.luaj.vm2.Prototype;
|
||||
import org.luaj.vm2.compiler.DumpState;
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
@@ -2,8 +2,7 @@ package org.luaj.vm2.compiler;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.luaj.vm2.*;
|
||||
import org.luaj.vm2.compiler.DumpState;
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.luaj.vm2.Globals;
|
||||
import org.luaj.vm2.LuaDouble;
|
||||
import org.luaj.vm2.LuaInteger;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.lib.jse.JsePlatform;
|
||||
import org.luaj.vm2.libs.jse.JsePlatform;
|
||||
|
||||
public class SimpleTests extends TestCase {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.luaj.vm2.require;
|
||||
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.lib.ZeroArgFunction;
|
||||
import org.luaj.vm2.libs.ZeroArgFunction;
|
||||
|
||||
/**
|
||||
* This should fail while trying to load via
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.luaj.vm2.require;
|
||||
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.lib.ZeroArgFunction;
|
||||
import org.luaj.vm2.libs.ZeroArgFunction;
|
||||
|
||||
/**
|
||||
* This should fail while trying to load via "require()" because it throws a RuntimeException
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.luaj.vm2.require;
|
||||
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.lib.TwoArgFunction;
|
||||
import org.luaj.vm2.libs.TwoArgFunction;
|
||||
|
||||
/**
|
||||
* This should succeed as a library that can be loaded dynamically via "require()"
|
||||
|
||||
@@ -40,7 +40,7 @@ import junit.framework.TestSuite;
|
||||
|
||||
import org.luaj.vm2.LuaFunction;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.lib.OneArgFunction;
|
||||
import org.luaj.vm2.libs.OneArgFunction;
|
||||
|
||||
public class ScriptEngineTests extends TestSuite {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user