Fix DATA
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user