1
0
This commit is contained in:
otya128
2015-06-03 19:51:42 +09:00
parent fb28e1236d
commit 6673ca3fc2
7 changed files with 449 additions and 0 deletions

37
SMILEBASIC/type.d Normal file
View File

@@ -0,0 +1,37 @@
module otya.smilebasic.type;
enum ValueType : byte
{
Integer,
Double,
String,
Array,
IntegerArray,
DoubleArray,
StringArray,
}
struct Value
{
ValueType type;
union
{
int integerValue;
double doubleValue;
wstring stringValue;
int[] intArray;
}
this(int value)
{
this.type = ValueType.Integer;
integerValue = value;
}
this(double value)
{
this.type = ValueType.Double;
doubleValue = value;
}
this(wstring value)
{
this.type = ValueType.String;
stringValue = value;
}
}