From c2154a2f9cda1913ca2f966fda842a861aa3a502 Mon Sep 17 00:00:00 2001 From: Tim Vaughan Date: Sun, 1 May 2016 00:23:39 +1200 Subject: [PATCH] Fixed problem with TICK, but now only works when compiled. --- src/forth.jl | 10 +++++++--- src/lib.4th | 8 ++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/forth.jl b/src/forth.jl index e7faf97..df86674 100644 --- a/src/forth.jl +++ b/src/forth.jl @@ -822,10 +822,14 @@ IMMEDIATE = defPrimWord("IMMEDIATE", () -> begin return NEXT end, flags=F_IMMED) +#TICK = defWord("'", +# [STATE_CFA, FETCH, ZBRANCH, 7, +# FROMR, DUP, INCR, TOR, FETCH, EXIT, +# WORD, FIND, TOCFA, EXIT]) + TICK = defWord("'", - [STATE_CFA, FETCH, ZBRANCH, 7, - FROMR, DUP, INCR, TOR, FETCH, EXIT, - WORD, FIND, TOCFA, EXIT]) + [FROMR, DUP, INCR, TOR, FETCH, EXIT]) + # Strings diff --git a/src/lib.4th b/src/lib.4th index d806cb8..5d6507d 100644 --- a/src/lib.4th +++ b/src/lib.4th @@ -572,7 +572,6 @@ ( begin the definition with : NAME [IMMEDIATE] ) ':' EMIT SPACE DUP ID. SPACE DUP ?IMMEDIATE IF ." IMMEDIATE " THEN - CR 8 SPACES >DFA ( get the data address, ie. points after DOCOL | end-of-word start-of-data ) @@ -580,9 +579,7 @@ BEGIN ( end start ) 2DUP > WHILE - DUP @ CFA> ID. SPACE - 1+ -( DUP @ ( end start codeword ) + DUP @ ( end start codeword ) CASE ' LIT OF ( is it LIT ? ) @@ -596,7 +593,7 @@ 2DUP TELL ( print the string ) '"' EMIT SPACE ( finish the string with a final quote ) + ( end start+1+len, aligned ) - 1- ( because we're about to add 1 below ) + 1- ( because we're about to add 4 below ) ENDOF ' 0BRANCH OF ( is it 0BRANCH ? ) ." 0BRANCH ( " @@ -633,7 +630,6 @@ ENDCASE 1+ ( end start+1 ) -) REPEAT ';' EMIT CR -- 2.20.1