Fix error

This commit is contained in:
otya128 committed 2016-12-23 21:09:38 +09:00
1 parent b0cd488f4f
commit acb51742b2
3 files changed
+11 -1

No files matched your search

+9 -1
View File
@@ -1560,7 +1560,15 @@ class CallBuiltinFunction : Code
arg = vm.stack[vm.stacki - argcount..vm.stacki];
result = vm.stack[vm.stacki/* - argcount */+ 1..vm.stacki + 1/* - argcount */+ outcount];//雑;
}
func.func(vm.petitcomputer, arg, result);
try
{
func.func(vm.petitcomputer, arg, result);
}
catch (SmileBasicError sbe)
{
sbe.func = func.name;
throw sbe;
}
if(func.variadic)
{
vm.stacki -= argcount;
+1
View File
@@ -10,6 +10,7 @@ class SmileBasicError : Exception
int errline;
int errprg;
string message2;
string func;
this(int slot, int line, string message)
{
super(format("%s in %d:%d", message, slot, line));
+1
View File
@@ -1230,6 +1230,7 @@ class PetitComputer
//print(sbe.to!string);
writeln(sbe.to!string);
writeln(sbe.getErrorMessage2);
writeln(sbe.func);
loc = vm.currentLocation;
console.print(loc.line, ":", loc.pos, ":", parser.getLine(loc));
}