removed Type.java and updated the depended files to use the new type constants
This commit is contained in:
@@ -29,13 +29,13 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import lua.CallInfo;
|
||||
import lua.Lua;
|
||||
import lua.StackState;
|
||||
import lua.addon.compile.LexState;
|
||||
import lua.io.LocVars;
|
||||
import lua.io.Proto;
|
||||
import lua.value.LTable;
|
||||
import lua.value.LValue;
|
||||
import lua.value.Type;
|
||||
|
||||
public class DebugStackState extends StackState implements DebugRequestListener {
|
||||
|
||||
@@ -310,17 +310,17 @@ public class DebugStackState extends StackState implements DebugRequestListener
|
||||
variablesSeen.add(varName);
|
||||
LValue value = stack[callInfo.base + i];
|
||||
if (value != null) {
|
||||
Type type = Type.valueOf(value.luaGetTypeName().toJavaString());
|
||||
int type = value.luaGetType();
|
||||
DebugUtils.print("\tType: " + type);
|
||||
if (type == Type.table) {
|
||||
if (type == Lua.LUA_TTABLE) {
|
||||
DebugUtils.println(" (selected)");
|
||||
variables.add(
|
||||
new TableVariable(localVariableCount++,
|
||||
varName,
|
||||
type,
|
||||
(LTable) value));
|
||||
} else if (type != Type.function &&
|
||||
type != Type.thread) {
|
||||
} else if (type != Lua.LUA_TFUNCTION &&
|
||||
type != LUA_TTHREAD) {
|
||||
DebugUtils.println(" (selected)");
|
||||
variables.add(
|
||||
new Variable(localVariableCount++,
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
******************************************************************************/
|
||||
package lua.debug;
|
||||
|
||||
import lua.Lua;
|
||||
import lua.value.LTable;
|
||||
import lua.value.LValue;
|
||||
import lua.value.Type;
|
||||
|
||||
public class TableVariable extends Variable {
|
||||
|
||||
@@ -31,7 +31,7 @@ public class TableVariable extends Variable {
|
||||
protected String[] keys;
|
||||
protected Object[] values;
|
||||
|
||||
public TableVariable(int index, String name, Type type, LTable table) {
|
||||
public TableVariable(int index, String name, int type, LTable table) {
|
||||
super(index, name, type, null);
|
||||
|
||||
int size = table.size();
|
||||
@@ -43,7 +43,7 @@ public class TableVariable extends Variable {
|
||||
this.keys[i] = keyValues[i].toString();
|
||||
LValue value = table.get(keyValues[i]);
|
||||
if (value instanceof LTable) {
|
||||
this.values[i] = new TableVariable(i, "<table>", Type.table, (LTable)value);
|
||||
this.values[i] = new TableVariable(i, "<table>", Lua.LUA_TTABLE, (LTable)value);
|
||||
} else {
|
||||
this.values[i] = value.toString();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ package lua.debug;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lua.value.Type;
|
||||
import lua.Lua;
|
||||
|
||||
public class Variable implements Serializable {
|
||||
private static final long serialVersionUID = 8194091816623233934L;
|
||||
@@ -31,9 +31,9 @@ public class Variable implements Serializable {
|
||||
protected int index;
|
||||
protected String name;
|
||||
protected String value;
|
||||
protected Type type;
|
||||
protected int type;
|
||||
|
||||
public Variable(int index, String name, Type type, String value) {
|
||||
public Variable(int index, String name, int type, String value) {
|
||||
this.index = index;
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
@@ -44,7 +44,7 @@ public class Variable implements Serializable {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
public int getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
@@ -61,6 +61,6 @@ public class Variable implements Serializable {
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "index: " + getIndex() + " name:" + getName() + " type: " + getType() + " value:" + getValue();
|
||||
return "index: " + getIndex() + " name:" + getName() + " type: " + Lua.TYPE_NAMES[getType()] + " value:" + getValue();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user