mirror of
https://github.com/Open-Argon/argon-v3.git
synced 2025-12-06 08:56:07 +00:00
add try catch
This commit is contained in:
22
src/run.go
22
src/run.go
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user