Change LString to use an array of bytes instead of wrapping Java's String.

This brings our implementation more in line with regular C Lua.
This commit is contained in:
Ian Farmer
2007-09-10 06:27:54 +00:00
parent aa44eedf4b
commit aeafca11b6
17 changed files with 274 additions and 84 deletions

View File

@@ -93,7 +93,7 @@ public class StandardTest extends TestCase {
CallInfo call = state.calls[i];
Proto p = call.closure.p;
int line = p.lineinfo[call.pc];
String func = call.closure.luaAsString();
String func = call.closure.luaAsString().toJavaString();
stackTrace[state.cc - i] = new StackTraceElement(getName(), func, getName()+".lua", line );
}

View File

@@ -72,7 +72,7 @@ public class LTableTest extends TestCase {
assertTrue( ( intKeys & mask ) == 0 );
intKeys |= mask;
} else if ( k instanceof LString ) {
final int ik = Integer.parseInt( k.luaAsString() );
final int ik = Integer.parseInt( k.luaAsString().toJavaString() );
assertEquals( String.valueOf( ik ), k.luaAsString() );
assertTrue( ik >= 0 && ik < 10 );
final int mask = 1 << ik;