Skip to content

Commit

Permalink
GH-18 Rename _abort, _quit, and _evaluate internal words from their
Browse files Browse the repository at this point in the history
Forth counter parts.
  • Loading branch information
SirWumpus committed Aug 19, 2024
1 parent 52f19e9 commit 18ae290
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/post4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -2988,7 +2988,7 @@ sig_int(int signum)
abort();
}

void
static void
cleanup(void)
{
p4Free(signal_ctx);
Expand Down
10 changes: 5 additions & 5 deletions src/post4.p4
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ MAX-U MAX-N 2CONSTANT MAX-D
\
\ (S: <spaces>name -- )
\
: DEFER CREATE ['] QUIT , DOES> @ EXECUTE ;
: DEFER CREATE ['] _quit , DOES> @ EXECUTE ;

\ ... DEFER! ...
\
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 ...
\
Expand All @@ -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 ...
\
Expand Down

0 comments on commit 18ae290

Please sign in to comment.