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

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)