From e3bee6e77d04f68fe14e4a0106f02d9284d7dcac Mon Sep 17 00:00:00 2001 From: Jonas Hvid Date: Sun, 4 Oct 2020 00:33:07 +0200 Subject: [PATCH] Implement '\'-style comments --- sys.f | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.39.2