Initial sources for planned 2.0 luaj vm release. Most interpreter features and library functions working.
This commit is contained in:
20
examples/jse/SampleJseMain.java
Normal file
20
examples/jse/SampleJseMain.java
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
import org.luaj.vm2.*;
|
||||
import org.luaj.vm2.lib.*;
|
||||
import org.luaj.vm2.compiler.LuaC;
|
||||
|
||||
public class SampleJseMain {
|
||||
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
String script = "examples/lua/hello.lua";
|
||||
|
||||
// create an environment to run in
|
||||
LuaC.install();
|
||||
LuaValue _G = JsePlatform.standardGlobals();
|
||||
_G.get("dofile").call( LuaValue.valueOf(script) );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user