Fixed problem with TICK, but now only works when compiled.
authorTim Vaughan <tgvaughan@gmail.com>
Sat, 30 Apr 2016 12:23:39 +0000 (00:23 +1200)
committerTim Vaughan <tgvaughan@gmail.com>
Sat, 30 Apr 2016 12:23:39 +0000 (00:23 +1200)
src/forth.jl
src/lib.4th

index e7faf97..df86674 100644 (file)
@@ -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
 
index d806cb8..5d6507d 100644 (file)
         ( 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 )
 
         BEGIN           ( end start )
                 2DUP >
         WHILE
-                DUP @ CFA> ID. SPACE
-                1+
-(                DUP @           ( end start codeword )
+                DUP @           ( end start codeword )
 
                 CASE
                 ' LIT OF                ( is it LIT ? )
                         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 ( "
                 ENDCASE
 
                 1+             ( end start+1 )
-)
         REPEAT
 
         ';' EMIT CR