1
0

SWAPを実装

This commit is contained in:
otya128
2016-09-03 11:46:11 +09:00
parent 69a4033250
commit 6505e41fd2
6 changed files with 155 additions and 0 deletions

View File

@@ -886,6 +886,12 @@ class Compiler
compilePopVar(i, sc);
}
}
void compileSwap(Swap swap, Scope sc)
{
compilePushReference(swap.item2, sc);
compilePushReference(swap.item1, sc);
genCode(new SwapCode());
}
void compileStatement(Statement i, Scope s)
{
switch(i.type)
@@ -1132,6 +1138,9 @@ class Compiler
}
}
break;
case NodeType.Swap:
compileSwap(cast(Swap)i, s);
break;
default:
stderr.writeln("Compile:NotImpl ", i.type);
}