From 4efe5ffa86c0e31397464266c8adc8692122bb1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sat, 27 Nov 2021 17:32:27 +0100 Subject: [PATCH] fixes --- README.md | 4 ++-- src/fh_runtime.c | 2 +- testfiles/combinedtest.f | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3ea50b5..9850210 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ HERE HOLD I IF IMMEDIATE INVERT J LEAVE LITERAL LOOP LSHIFT M* MAX MIN MOD MOVE REPEAT ROT RSHIFT S>D S" SIGN SM/REM SOURCE SPACE SPACES STATE SWAP THEN TYPE U. U< UNTIL UM* UM/MOD UNLOOP VARIABLE WHILE WORD XOR [ ['] [CHAR] ] CORE-EXT: -.( .R :NONAME 0<> 0> 2>R 2R> 2R@ <> ?DO ACTION-OF AGAIN BUFFER: C" CASE COMPILE, DEFER DEFER! DEFER@ ENDCASE ENDOF ERASE FALSE HEX HOLDS IS MARKER NIP OF PAD PARSE PARSE-NAME PICK RESTORE-INPUT SAVE-INPUT ROLL S\" TO TRUE TUCK U.R U> UNUSED VALUE WITHIN +.( .R :NONAME 0<> 0> 2>R 2R> 2R@ <> ?DO ACTION-OF AGAIN BUFFER: C" CASE COMPILE, DEFER DEFER! DEFER@ ENDCASE ENDOF ERASE FALSE HEX HOLDS IS MARKER NIP OF PAD PARSE PARSE-NAME PICK REFILL RESTORE-INPUT SAVE-INPUT SOURCE-ID ROLL S\" TO TRUE TUCK U.R U> UNUSED VALUE WITHIN \ Other sets: @@ -69,7 +69,7 @@ CORE: ACCEPT KEY CORE-EXT: -REFILL SOURCE-ID [COMPILE] +[COMPILE] ``` . diff --git a/src/fh_runtime.c b/src/fh_runtime.c index ae051bb..bc74050 100644 --- a/src/fh_runtime.c +++ b/src/fh_runtime.c @@ -64,7 +64,7 @@ void fh_drop_to_interactive(struct fh_thread_s *fh) { } void fh_quit(struct fh_thread_s *fh) { - if (fh_globals.interactive) { + if (fh_globals.interactive || fh_globals.rescue) { fh_drop_to_interactive(fh); fh_setstate(fh, FH_STATE_QUIT, 0); } else { diff --git a/testfiles/combinedtest.f b/testfiles/combinedtest.f index a134c12..1dba314 100644 --- a/testfiles/combinedtest.f +++ b/testfiles/combinedtest.f @@ -25,6 +25,9 @@ VARIABLE VERBOSE VARIABLE #ERRORS 0 #ERRORS ! +: ERROR TYPE QUIT ; + +0 [if] : ERROR \ ( C-ADDR U -- ) DISPLAY AN ERROR MESSAGE FOLLOWED BY \ THE LINE THAT HAD THE ERROR. CR TYPE SOURCE TYPE \ DISPLAY LINE CORRESPONDING TO ERROR @@ -32,6 +35,7 @@ VARIABLE #ERRORS 0 #ERRORS ! #ERRORS @ 1 + #ERRORS ! \ QUIT \ *** Uncomment this line to QUIT on an error ; +[then] VARIABLE ACTUAL-DEPTH \ STACK RECORD CREATE ACTUAL-RESULTS 20 CELLS ALLOT @@ -1798,6 +1802,7 @@ TESTING S\" (Forth 2012 compilation mode) \ interpretation semantics. S\" in interpretation mode is tested in the tests on \ the File-Access word set +1 debug T{ : SSQ1 S\" abc" S" abc" S= ; -> }T \ No escapes T{ SSQ1 -> TRUE }T T{ : SSQ2 S\" " ; SSQ2 SWAP DROP -> 0 }T \ Empty string