retroforth/interface/error.retro
crc dad3833893 a formatting tweak
FossilOrigin-Name: 9ac60ea565b65f9785d1f901854bdc5dafc52f31601613f7276913b55d2f82b7
2023-10-22 22:09:49 +00:00

23 lines
597 B
Forth

~~~
:err:set-handler (nn-)
#1234 io:scan-for
dup n:negative? [ drop 'Error:_device_(1234)_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
~~~