1
0

RESTORE (式)に対応

This commit is contained in:
otya128
2015-08-25 19:52:40 +09:00
parent 40b06463de
commit 750fedcbfc
4 changed files with 51 additions and 3 deletions

View File

@@ -847,7 +847,22 @@ class Compiler
compileRead(cast(Read)i, s);
break;
case NodeType.Restore:
genCode(new RestoreCodeS((cast(Constant)(cast(Restore)i).label).value.stringValue));
{
Restore restore = cast(Restore)i;
Expression label = restore.label;
if(label.type == NodeType.Constant)
{
Constant cons = cast(Constant)label;
if(cons.value.isString)
{
genCode(new RestoreCodeS(cons.value.stringValue));
break;
//文字列じゃないならば定数でも実行時エラー
}
}
compileExpression(label, s);
genCode(new RestoreExprCode(s.data));
}
break;
case NodeType.On:
compileOn(cast(On)i, s);