From: Jonas Hvid Date: Sat, 3 Oct 2020 22:33:07 +0000 (+0200) Subject: Implement '\'-style comments X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=e3bee6e77d04f68fe14e4a0106f02d9284d7dcac;p=rrq%2Fjonasforth.git Implement '\'-style comments --- diff --git a/sys.f b/sys.f index 0815e0f..38708d1 100644 --- a/sys.f +++ b/sys.f @@ -47,7 +47,7 @@ EXIT [ ELSE DROP THEN - AGAIN ; + AGAIN ; ( Yay! We now have comments! ) : UNTIL IMMEDIATE ' 0BRANCH , @@ -69,6 +69,12 @@ EXIT [ : OVER ( a b -- a b a ) SWAP DUP ROT ; +( An alternative comment syntax. Reads until the end of the line. ) +: \ IMMEDIATE + BEGIN + KEY + 10 = UNTIL ; + ( Compile the given string into the current word directly. ) : STORE-STRING ( str len -- ) BEGIN