1
0

関数内ラベル実装と引数なし関数を正常に呼べるようにした

This commit is contained in:
otya128
2015-07-13 21:39:42 +09:00
parent b51fe86fd6
commit 5dff13b64f
8 changed files with 215 additions and 47 deletions

View File

@@ -486,14 +486,16 @@ class GotoAddr : Code
class GotoS : Code
{
wstring label;
this(wstring label)
Scope sc;
this(wstring label, Scope sc)
{
this.type = CodeType.GotoS;
this.label = label;
this.sc = sc;
}
override void execute(VM vm)
{
stderr.writeln("can't execute");
stderr.writeln("can't execute (compiler bug?)");
}
}
class GotoTrue : Code
@@ -545,14 +547,16 @@ class GosubAddr : Code
class GosubS : Code
{
wstring label;
this(wstring label)
Scope sc;
this(wstring label, Scope sc)
{
this.type = CodeType.GosubS;
this.label = label;
this.sc = sc;
}
override void execute(VM vm)
{
stderr.writeln("can't execute");
stderr.writeln("can't execute (compiler bug?)");
}
}
class ReturnSubroutine : Code
@@ -829,7 +833,7 @@ class CallFunctionCode : Code
}
override void execute(VM vm)
{
Function func = vm.functions[name];
Function func = vm.functions.get(name, null);
if(!func)
{
throw new SyntaxError();