From 18ae290b9e81e6489e457212c89c5f2c0668e509 Mon Sep 17 00:00:00 2001 From: Anthony Howe Date: Mon, 19 Aug 2024 09:11:23 -0400 Subject: [PATCH] GH-18 Rename _abort, _quit, and _evaluate internal words from their Forth counter parts. --- src/post4.c | 8 ++++---- src/post4.p4 | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/post4.c b/src/post4.c index bb8d9c3..dca300e 100755 --- a/src/post4.c +++ b/src/post4.c @@ -1285,8 +1285,8 @@ p4Repl(P4_Ctx *ctx, int rc) P4_WORD("_repl", &&_repl, P4_BIT_HIDDEN, 0x00), P4_WORD("LIT", &&_lit, 0, 0x01), // historic P4_WORD(";", &&_exit, P4_BIT_HIDDEN, 0x10), // _seext - P4_WORD("ABORT", &&_abort, 0, 0x00), - P4_WORD("QUIT", &&_quit, 0, 0x00), + P4_WORD("_abort", &&_abort, 0, 0x00), + P4_WORD("_quit", &&_quit, 0, 0x00), #ifdef HAVE_MATH_H // P4_WORD("min-float", &&_min_float, 0, 0x01), // p4 P4_WORD("max-float", &&_max_float, 0, 0x01), // p4 @@ -1384,7 +1384,7 @@ p4Repl(P4_Ctx *ctx, int rc) P4_WORD(">BODY", &&_body, 0, 0x01), P4_WORD("CREATE", &&_create, 0, 0x01), P4_WORD("DOES>", &&_does, P4_BIT_COMPILE, 0x1000), - P4_WORD("EVALUATE", &&_evaluate, 0, 0x20), + P4_WORD("_evaluate", &&_evaluate, 0, 0x20), // p4 P4_WORD("EXECUTE", &&_execute, 0, 0x10), P4_WORD("EXIT", &&_exit, P4_BIT_COMPILE, 0x1000), P4_WORD("IMMEDIATE", &&_immediate, 0, 0x00), @@ -2988,7 +2988,7 @@ sig_int(int signum) abort(); } -void +static void cleanup(void) { p4Free(signal_ctx); diff --git a/src/post4.p4 b/src/post4.p4 index e8ebef6..105d2ba 100755 --- a/src/post4.p4 +++ b/src/post4.p4 @@ -619,7 +619,7 @@ MAX-U MAX-N 2CONSTANT MAX-D \ \ (S: name -- ) \ -: DEFER CREATE ['] QUIT , DOES> @ EXECUTE ; +: DEFER CREATE ['] _quit , DOES> @ EXECUTE ; \ ... DEFER! ... \ @@ -665,7 +665,7 @@ DEFER _fsp! ?DUP IF \ S: n R: \ When no catch frame, throw to C. catch_frame @ 0= IF \ S: n R: - ABORT \ S: -- R: -- + _abort \ S: -- R: -- THEN \ Restore return stack of CATCH at EXECUTE. catch_frame @ _rsp! \ S: n R: ip ds fs cf @@ -688,7 +688,7 @@ DEFER _fsp! \ \ printf "' quit catch \n abort" | ./post4 ; echo $? \ -: QUIT 0 catch_frame ! QUIT ; +: QUIT 0 catch_frame ! _quit ; \ ( xt -- ) : execute-compiling @@ -1900,7 +1900,7 @@ VARIABLE SCR \ \ (S: i*x u -- j*x ) \ -: LOAD _input_push DUP BLK ! BLOCK 1024 ['] EVALUATE CATCH _input_pop THROW ; +: LOAD _input_push DUP BLK ! BLOCK 1024 ['] _evaluate CATCH _input_pop THROW ; \ ... EVALUATE ... \ @@ -1909,7 +1909,7 @@ VARIABLE SCR \ @see \ https://forth-standard.org/standard/block/EVALUATE \ -: EVALUATE _input_push ['] EVALUATE CATCH _input_pop THROW ; +: EVALUATE _input_push ['] _evaluate CATCH _input_pop THROW ; \ ... THRU ... \