1
0

ダイレクトモードを実装

This commit is contained in:
otya128
2016-02-22 23:08:54 +09:00
parent 76aea0c4e6
commit 5f0078a8f9
4 changed files with 73 additions and 6 deletions

View File

@@ -1185,8 +1185,43 @@ class PetitComputer
}
auto prg = input("", true);
parser = new Parser(prg);
auto cc = parser.compiler;
cc.compileDirectMode(vm);
try
{
auto cc = parser.compiler;
cc.compileDirectMode(vm);
}
catch(SmileBasicError sbe)
{
try
{
printConsole(sbe.getErrorMessage, "\n");
printConsole(sbe.getErrorMessage2, "\n");
//printConsole(sbe.to!string);
writeln(sbe.to!string);
writeln(sbe.getErrorMessage2);
auto loc = vm.currentLocation;
printConsole(loc.line, ":", loc.pos, ":", parser.getLine(loc));
}
catch(Throwable t)
{
writeln(t);
}
continue;
}
catch(Throwable t)
{
try
{
printConsole(t.to!string);
writeln(t);
printConsole(parser.getLine(vm.currentLocation));
}
catch(Throwable t)
{
writeln(t);
}
continue;
}
vm.dump();
running = true;
}