Add function data to stack frame
This commit is contained in:
1 parent
edf4b8b185
commit
d3c4392087
3 files changed
+23
-1
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user