diff --git a/defs.frp b/defs.frp index f9ed1a5..e38ff3b 100755 --- a/defs.frp +++ b/defs.frp @@ -2,9 +2,6 @@ s" forp.log" open const LOGFILE : log-emit LOGFILE fputc ; -stdout -' log-emit task-echo ! - 2 const cell : cells cell * ; diff --git a/forp.c b/forp.c index 9f3ab96..38f4b87 100755 --- a/forp.c +++ b/forp.c @@ -294,25 +294,23 @@ void f_cdef() { // func name -- DROP(1); } +void f_docolon(); +// C code must always call a colon word through f_execute() void f_execute() { cell oldW = W; cell oldIP = IP; - cell *oldRstack; cell retIP; retIP.p = NULL; - RPUSH(retIP); - oldRstack = rstack; + if (W.p->f == f_docolon) { + RPUSH(retIP); + } W = TOP(); DROP(1); W.p->f(); - if (oldRstack == rstack) { - RPOP(); - } W = oldW; IP = oldIP; } -void f_docolon(); void f_colonloop() { while (IP.p) { cell codeptr; @@ -425,9 +423,7 @@ void f_colon() { void f_interpretword() { // codefield flags -- if (!STATE.i || (TOP().u & F_IMMEDIATE)) { DROP(1); - W = TOP(); // w code - DROP(1); - W.p->f(); + f_execute(); } else { DROP(1); f_comma(); diff --git a/game.exe b/game.exe index 0bc30de..2fb1c44 100755 Binary files a/game.exe and b/game.exe differ diff --git a/game.prj b/game.prj index e5c8197..e87f257 100755 Binary files a/game.prj and b/game.prj differ