retroforth/interface/error.retro
crc 8e4faa5479 most words now have stack comments recorded
FossilOrigin-Name: a3dadc3c3eb2a5fbf6861ea99053a0b160398f01b3f9bc60aacba463f5a7025e
2024-09-09 15:49:02 +00:00

23 lines
620 B
Forth

~~~
:err:set-handler (:nn-)
DEVICE:ERROR io:scan-for
dup n:negative? [ drop 'Error:_error_handling_device_not_found s:put nl ] if;
#0 swap io:invoke ;
:err:dsu (:-)
reset nl 'ERROR:_DSU:_DATA_STACK_UNDERFLOW s:put nl bye ;
:err:dso (:-)
reset nl 'ERROR:_DSO:_DATA_STACK_OVERFLOW s:put nl bye ;
:err:set-defaults (:-)
&err:dsu #1 err:set-handler
&err:dso #2 err:set-handler ;
'interface/error.retro s:keep
dup 'err:set-handler d:lookup d:source store
dup 'err:set-defaults d:lookup d:source store
dup 'err:dso d:lookup d:source store
dup 'err:dsu d:lookup d:source store
drop
~~~