version 1.9, 2003/11/23 22:52:29
|
version 1.10, 2006/05/26 21:18:45
|
Line 85 Defer store-backtrace
|
Line 85 Defer store-backtrace
|
lp@ >r |
lp@ >r |
handler @ >r |
handler @ >r |
rp@ handler ! |
rp@ handler ! |
backtrace-empty on |
|
>r ; |
>r ; |
|
|
: try ( compilation -- orig ; run-time -- ) \ gforth |
: try ( compilation -- orig ; run-time -- ) \ gforth |
Line 126 is catch
|
Line 125 is catch
|
:noname ( y1 .. ym error/0 -- y1 .. ym / z1 .. zn error ) \ exception |
:noname ( y1 .. ym error/0 -- y1 .. ym / z1 .. zn error ) \ exception |
?DUP IF |
?DUP IF |
[ here forthstart 9 cells + ! ] |
[ here forthstart 9 cells + ! ] |
store-backtrace |
store-backtrace error-stack off |
handler @ ?dup-0=-IF |
handler @ ?dup-0=-IF |
>stderr cr ." uncaught exception: " .error cr |
>stderr cr ." uncaught exception: " .error cr |
2 (bye) |
2 (bye) |
Line 140 is catch
|
Line 139 is catch
|
rdrop 'throw r> perform |
rdrop 'throw r> perform |
THEN ; |
THEN ; |
is throw |
is throw |
|
[IFDEF] throw>error |
|
:noname ( y1 .. ym error/0 -- y1 .. ym / z1 .. zn error ) \ exception |
|
?DUP IF |
|
handler @ ?dup-0=-IF |
|
>stderr cr ." uncaught exception: " .error cr |
|
2 (bye) |
|
\ quit |
|
THEN |
|
rp! |
|
r> handler ! |
|
r> lp! |
|
r> fp! |
|
r> swap >r sp! drop r> |
|
rdrop 'throw r> perform |
|
THEN ; |
|
is throw>error |
|
[THEN] |
|
|