OUT関数を実装, 識別子に数字と_を認識するように修正
This commit is contained in:
@@ -770,6 +770,14 @@ class ReturnFunction : Code
|
||||
{
|
||||
vm.push(retexpr);
|
||||
}
|
||||
else
|
||||
{
|
||||
//OUTの実装
|
||||
for(int i = 0; i < func.outArgCount; i++)
|
||||
{
|
||||
vm.push(vm.stack[vm.bp + i + 2]);
|
||||
}
|
||||
}
|
||||
vm.pc = pc.integerValue;
|
||||
vm.bp = bp.integerValue;
|
||||
}
|
||||
@@ -778,10 +786,18 @@ class CallFunctionCode : Code
|
||||
{
|
||||
wstring name;
|
||||
int argCount;
|
||||
int outArgCount;
|
||||
this(wstring name, int argCount)
|
||||
{
|
||||
this.name = name;
|
||||
this.argCount = argCount;
|
||||
this.outArgCount = 1;
|
||||
}
|
||||
this(wstring name, int argCount, int outArgCount)
|
||||
{
|
||||
this.name = name;
|
||||
this.argCount = argCount;
|
||||
this.outArgCount = outArgCount;
|
||||
}
|
||||
override void execute(VM vm)
|
||||
{
|
||||
@@ -794,6 +810,10 @@ class CallFunctionCode : Code
|
||||
{
|
||||
throw new IllegalFunctionCall();
|
||||
}
|
||||
if(func.outArgCount != this.outArgCount)
|
||||
{
|
||||
throw new IllegalFunctionCall();
|
||||
}
|
||||
//TODO:args
|
||||
auto bp = vm.stacki;
|
||||
vm.push(Value(vm.bp));
|
||||
|
||||
Reference in New Issue
Block a user