1
0

Fix error

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

View File

@@ -1560,7 +1560,15 @@ class CallBuiltinFunction : Code
arg = vm.stack[vm.stacki - argcount..vm.stacki]; arg = vm.stack[vm.stacki - argcount..vm.stacki];
result = vm.stack[vm.stacki/* - argcount */+ 1..vm.stacki + 1/* - argcount */+ outcount];//雑; 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) if(func.variadic)
{ {
vm.stacki -= argcount; vm.stacki -= argcount;

View File

@@ -10,6 +10,7 @@ class SmileBasicError : Exception
int errline; int errline;
int errprg; int errprg;
string message2; string message2;
string func;
this(int slot, int line, string message) this(int slot, int line, string message)
{ {
super(format("%s in %d:%d", message, slot, line)); super(format("%s in %d:%d", message, slot, line));

View File

@@ -1230,6 +1230,7 @@ class PetitComputer
//print(sbe.to!string); //print(sbe.to!string);
writeln(sbe.to!string); writeln(sbe.to!string);
writeln(sbe.getErrorMessage2); writeln(sbe.getErrorMessage2);
writeln(sbe.func);
loc = vm.currentLocation; loc = vm.currentLocation;
console.print(loc.line, ":", loc.pos, ":", parser.getLine(loc)); console.print(loc.line, ":", loc.pos, ":", parser.getLine(loc));
} }