1
0

CALLを実装

This commit is contained in:
otya128
2016-08-31 16:46:11 +09:00
parent 4015f6be43
commit e9c94f5bbd
5 changed files with 132 additions and 12 deletions

View File

@@ -496,9 +496,16 @@ class Compiler
{
genCode(new CallBuiltinFunction(bfun, cast(int)func.args.length, 1));
}
else if (func.name == "CALL")
{
if (func.args.length < 1)
{
throw new SyntaxError();
}
genCode(new CallFunctionS((cast(int)func.args.length) - 1, 1));
}
else
{
writeln(func.name);
genCode(new CallFunctionCode(func.name, cast(int)func.args.length));
}
}
@@ -911,9 +918,12 @@ class Compiler
{
genCode(new CallBuiltinFunction(bfun, cast(int)func.args.length, cast(int)bfun.results.length));//func.outVariable.length));
}
else if (func.name == "CALL")
{
genCode(new CallFunctionS((cast(int)func.args.length) - 1, cast(int)func.outVariable.length));
}
else
{
writeln(func.name);
genCode(new CallFunctionCode(func.name, cast(int)func.args.length, cast(int)func.outVariable.length));
}
if(bfun)