Refactor java code generator.

This commit is contained in:
James Roseborough
2010-04-13 14:31:40 +00:00
parent a8f129b8cf
commit 8ae33e1d08
39 changed files with 1711 additions and 13156 deletions

View File

@@ -25,7 +25,7 @@ import junit.framework.Test;
import junit.framework.TestSuite;
import org.luaj.vm2.compiler.LuaC;
import org.luaj.vm2.luajc.JavaBytecodeCompiler;
import org.luaj.vm2.luajc.LuaJC;
/**
* Compatibility tests for the Luaj VM
@@ -92,7 +92,7 @@ public class CompatibiltyTest {
protected void setUp() throws Exception {
super.setUp();
System.setProperty("JME", "false");
JavaBytecodeCompiler.install();
LuaJC.install();
}
// not supported on this platform - don't test
public void testDebugLib() {}

View File

@@ -27,7 +27,7 @@ import java.io.InputStream;
import junit.framework.TestCase;
import org.luaj.vm2.compiler.LuaC;
import org.luaj.vm2.luajc.JavaBytecodeCompiler;
import org.luaj.vm2.luajc.LuaJC;
/**
* Test compilation of various fragments that have
@@ -43,7 +43,7 @@ public class FragmentsTest extends TestCase {
InputStream is = new ByteArrayInputStream(script.getBytes("UTF-8"));
LuaValue chunk ;
if ( true ) {
chunk = JavaBytecodeCompiler.load(is,name,_G);
chunk = LuaJC.getInstance().load(is,name,_G);
} else {
chunk = (new LuaC()).load( is, name, _G );
}

View File

@@ -32,7 +32,7 @@ import java.io.PrintStream;
import junit.framework.TestCase;
import org.luaj.vm2.lib.BaseLib;
import org.luaj.vm2.luajc.JavaBytecodeCompiler;
import org.luaj.vm2.luajc.LuaJC;
abstract
public class ScriptDrivenTest extends TestCase {
@@ -111,7 +111,7 @@ public class ScriptDrivenTest extends TestCase {
return c;
} else {
script = new FileInputStream(file);
return JavaBytecodeCompiler.load( script, name, _G);
return LuaJC.getInstance().load( script, name, _G);
}
default:
script = new FileInputStream(file);