Add new built-in function type() that returns the name of the type of
the given value as a string. Includes test case.
This commit is contained in:
@@ -6,6 +6,8 @@ public final class LBoolean extends LValue {
|
||||
|
||||
public static final LBoolean FALSE = new LBoolean("false",false);
|
||||
|
||||
public static final LString TYPE_NAME = new LString("boolean");
|
||||
|
||||
private final String m_name;
|
||||
private final boolean m_value;
|
||||
|
||||
@@ -25,4 +27,8 @@ public final class LBoolean extends LValue {
|
||||
public final static LBoolean valueOf(boolean value) {
|
||||
return value? TRUE: FALSE;
|
||||
}
|
||||
|
||||
public LString luaGetType() {
|
||||
return TYPE_NAME;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user