( Title: Enhanced error display for otester File: otester-errors.fs Log File: otester.log Author: David N. Williams License: Public Domain Version: 1.4.3 Revised: January 18, 2021 The date above may reflect unlogged cosmetic changes. This file assumes that otester.fs and tester-display.fs are loaded. ) VARIABLE OT-#ERRORS 0 OT-#ERRORS ! : OT-ERROR1 ( c-addr u -- ) \ Display an error message followed by the line that had the error. red-text 1 OT-#ERRORS +! OT-ERROR-DEFAULT normal-text ; \ ' OT-ERROR1 OT-ERROR-XT ! \ display results and goals : ot-a. ( 'buffer c-addr u -- ) blue-text type ( 'buffer) dup >r @ dup IF 1- r> cell+ swap cells over + \ display deepest first DO i @ . -1 cells +LOOP ELSE r> 2drop ." none" THEN cr normal-text ; : OT-ERROR2 ( c-addr u -- ) OT-ERROR1 OT-RESULTS s" oresults: " ot-a. OT-GOALS s" ogoals: " ot-a. ; \ ' XT-ERROR2 XT-ERROR-XT ! \ fancy results and goals display : ot-fancy-a. ( 'buffer c-addr u -- ) blue-text type ( 'buffer) dup @ swap cell+ swap ?dup IF ( n) 1- 0 swap \ display deepest first DO ( 'elem) i cells over + @ i 1+ OT-ERROR-INDEX @ = IF red-text . blue-text ELSE . THEN -1 +LOOP ELSE ." none" THEN drop cr normal-text ; : OT-ERROR3 ( c-addr u -- ) OT-ERROR1 OT-RESULTS s" oresults: " ot-fancy-a. OT-GOALS s" ogoals: " ot-fancy-a. ; ' OT-ERROR3 OT-ERROR-XT ! : .ot-errors ( -- ) blue-text ." OT-ERRORS: " normal-text OT-#ERRORS @ . ; : ?.ot-errors ( -- ) VERBOSE @ IF .ot-errors THEN ;