1
0

ArrayAssignのbreak;忘れを修正,suffix無指定時の型をdoubleにした

This commit is contained in:
otya128
2015-06-12 22:07:48 +09:00
parent f84c4d20e5
commit 09ff06ec56
3 changed files with 5 additions and 3 deletions

View File

@@ -390,6 +390,7 @@ class Compiler
compileExpression(assign.indexExpression);
genCode(new PopGArray(getGlobalVarIndex(assign.name), assign.indexExpression.expressions.length));
}
break;
default:
stderr.writeln("Compile:NotImpl ", i.type);
}
@@ -422,6 +423,6 @@ unittest
auto parser = new Parser("A=1+2+3+4*5/4-5+(6+6)*7");
auto vm = parser.compile();
vm.run();
writeln(vm.testGetGlobalVariable("A").integerValue);
assert(vm.testGetGlobalVariable("A").integerValue == 1+2+3+4*5/4-5+(6+6)*7);
writeln(vm.testGetGlobalVariable("A").castDouble);
assert(vm.testGetGlobalVariable("A").castDouble == 1+2+3+4*5/4-5+(6+6)*7);
}