add try catch

This commit is contained in:
2023-03-28 16:00:17 +01:00
parent 5a785cbbc6
commit efd43ad72d
5 changed files with 91 additions and 4 deletions

View File

@@ -197,6 +197,14 @@ func runVal(line any, stack stack, stacklevel int) (any, ArErr) {
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{}
}