From 9760c960df61f17559573c8297bf2bece222005e Mon Sep 17 00:00:00 2001 From: Tim Vaughan Date: Mon, 2 May 2016 23:44:46 +1200 Subject: [PATCH] Added .(, ." no longer applies in immediate mode. --- src/lib.4th | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/lib.4th b/src/lib.4th index 9e40b2d..38a8d14 100644 --- a/src/lib.4th +++ b/src/lib.4th @@ -449,22 +449,20 @@ ; : ." IMMEDIATE ( -- ) - STATE @ IF ( compiling? ) - [COMPILE] S" ( read the string, and compile LITSTRING, etc. ) - ['] TELL , ( compile the final TELL ) - ELSE - ( In immediate mode, just read characters and print them until we get - to the ending double quote. ) - KEY DROP - BEGIN - KEY - DUP '"' = IF - DROP ( drop the double quote character ) - EXIT ( return from this function ) - THEN - EMIT - AGAIN - THEN + [COMPILE] S" ( read the string, and compile LITSTRING, etc. ) + ['] TELL , ( compile the final TELL ) +; + +: .( + KEY DROP + BEGIN + KEY + DUP ')' = IF + DROP ( drop the double quote character ) + EXIT ( return from this function ) + THEN + EMIT + AGAIN ; -- 2.20.1