Added unicode completion support to repl. Closes #6.
[forth.jl.git] / src / lib_7_vocab.4th
index 5f13b47..22d98b5 100644 (file)
@@ -10,7 +10,7 @@
 
         >link
 
-        DUP @ LATEST !      ( set LATEST to point to the previous word )
+        dup @ current @ 1+ !      ( set LATEST to point to the previous word )
 ;
 
 \ Mark word as hidden
@@ -35,7 +35,7 @@
         WHILE
                 SWAP 1+         ( addr len -- len addr+1 )
                 DUP @           ( len addr -- len addr char | get the next character)
-                DUP 32 >= OVER 127 <= AND IF
+                DUP 32 >= IF
                         EMIT    ( len addr char -- len addr | and print it)
                 ELSE
                         BASE @ SWAP HEX
@@ -70,11 +70,10 @@ vocabulary ROOT
 ;
 
 : PREVIOUS
-        #context @ 1 > if
-                1 #context -!
-        else
-                CR ." Cannot empty search order stack!"
-        then
+        #context @
+        1 <= abort" Cannot empty search order stack!"
+
+        1 #context -!
 ;
 
 : ALSO