This commit is contained in:
otya128 committed 2016-12-23 22:08:46 +09:00
1 parent f0b598e35e
commit 58cf9048a5
4 files changed
+51 -26

No files matched your search

+21
View File
@@ -17,6 +17,21 @@ enum ValueType : byte
DoubleReference,
StringReference,
StringArrayReference,
Data,
}
import otya.smilebasic.compiler;
import otya.smilebasic.vm;
struct Data
{
DataTable table;
int index;
void read(out Value value, VM vm)
{
if(index >= table.data.length)
throw new OutOfDATA();
value = table.data[index];
index++;
}
}
struct VMAddress
{
@@ -40,6 +55,7 @@ struct Value
ArrayReference!double doubleReference;
ArrayReference!wchar stringReference;
ArrayReference!(Array!wchar) stringArrayReference;
Data data;
}
this(int value)
{
@@ -108,6 +124,11 @@ struct Value
this.type = ValueType.StringArrayReference;
stringArrayReference = r;
}
this(Data data)
{
this.type = ValueType.Data;
this.data = data;
}
void castOp(ValueType type)
{
switch(type)