( Title: Enhanced error display for xtester File: xtester-errors.fs Log File: xftester.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 xtester.fs and tester-display.fs are loaded. ) VARIABLE XT-#ERRORS 0 XT-#ERRORS ! : XT-ERROR1 ( c-addr u -- ) \ Display an error message followed by the line that had the error. red-text 1 XT-#ERRORS +! XT-ERROR-DEFAULT normal-text ; \ ' XT-ERROR1 XT-ERROR-XT ! \ display results and goals : xt-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 ; : XT-ERROR2 ( c-addr u -- ) XT-ERROR1 XT-RESULTS s" xresults: " xt-a. XT-GOALS s" xgoals: " xt-a. ; \ ' XT-ERROR2 XT-ERROR-XT ! \ fancy results and goals display : xt-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+ XT-ERROR-INDEX @ = IF red-text . blue-text ELSE . THEN -1 +LOOP ELSE ." none" THEN drop cr normal-text ; : XT-ERROR3 ( c-addr u -- ) XT-ERROR1 XT-RESULTS s" xresults: " xt-fancy-a. XT-GOALS s" xgoals: " xt-fancy-a. ; ' XT-ERROR3 XT-ERROR-XT ! : .xt-errors ( -- ) blue-text ." XT-ERRORS: " normal-text XT-#ERRORS @ . ; : ?.xt-errors ( -- ) VERBOSE @ IF .xt-errors THEN ;