Fix basic class processing via metatables. Make print output more closely match that produces by C interpreter
This commit is contained in:
@@ -4,7 +4,7 @@ import lua.StackState;
|
||||
|
||||
public class LFunction extends LValue {
|
||||
|
||||
public String toString() {
|
||||
public String luaAsString() {
|
||||
return "function: "+hashCode();
|
||||
}
|
||||
|
||||
|
||||
@@ -50,10 +50,14 @@ public class LTable extends LValue {
|
||||
state.stack[base] = val;
|
||||
}
|
||||
|
||||
public String luaAsString() {
|
||||
public String toString() {
|
||||
return m_hash.toString();
|
||||
}
|
||||
|
||||
public String luaAsString() {
|
||||
return "table: "+id();
|
||||
}
|
||||
|
||||
/** Built-in opcode LEN, for Strings and Tables */
|
||||
public LValue luaLength() {
|
||||
return new LInteger( m_hash.size() );
|
||||
|
||||
@@ -9,6 +9,10 @@ public class LValue {
|
||||
protected static LValue luaUnsupportedOperation() {
|
||||
throw new java.lang.UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public String id() {
|
||||
return Integer.toHexString(hashCode());
|
||||
}
|
||||
|
||||
// test if value is true
|
||||
public boolean luaAsBoolean() {
|
||||
|
||||
Reference in New Issue
Block a user