From: Tim Vaughan Date: Mon, 2 May 2016 11:44:46 +0000 (+1200) Subject: Added .(, ." no longer applies in immediate mode. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=forth.jl.git;a=commitdiff_plain;h=9760c960df61f17559573c8297bf2bece222005e Added .(, ." no longer applies in immediate mode. --- 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 ;