add try catch

This commit is contained in:
2023-03-28 16:00:17 +01:00
parent c698b878da
commit 58c57f154b

View File

@@ -189,11 +189,23 @@ func runVal(line any, stack stack, stacklevel int) (any, ArErr) {
break
}
return runImport(x, stack, stacklevel+1)
case bool:
return x, ArErr{}
case nil:
return x, ArErr{}
case ArObject:
case ABS:
if stackoverflow {
linenum = x.line
path = x.path
code = x.code
break
}
return runAbs(x, stack, stacklevel+1)
case TryCatch:
if stackoverflow {
linenum = x.line
path = x.path
code = x.code
break
}
return runTryCatch(x, stack, stacklevel+1)
case bool, ArObject, number, nil:
return x, ArErr{}
}
if stackoverflow {