1
0

Add function data to stack frame

This commit is contained in:
otya128
2016-12-24 19:29:37 +09:00
parent edf4b8b185
commit d3c4392087
3 changed files with 23 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ enum ValueType : byte
StringReference,
StringArrayReference,
Data,
Function,
}
import otya.smilebasic.compiler;
import otya.smilebasic.vm;
@@ -56,6 +57,7 @@ struct Value
ArrayReference!wchar stringReference;
ArrayReference!(Array!wchar) stringArrayReference;
Data data;
Function func;
}
this(int value)
{
@@ -129,6 +131,11 @@ struct Value
this.type = ValueType.Data;
this.data = data;
}
this(Function func)
{
this.type = ValueType.Function;
this.func = func;
}
void castOp(ValueType type)
{
switch(type)