X-Git-Url: http://git.subgeniuskitty.com/pforth/.git/blobdiff_plain/f9a1c9cea42bd3c290b8823e1ece25a3bc878462..fe6f537b3e23ad201ba6236a6cedef2e565349a7:/fth/file.fth diff --git a/fth/file.fth b/fth/file.fth index b71edc5..6b0db20 100644 --- a/fth/file.fth +++ b/fth/file.fth @@ -61,6 +61,16 @@ create (LINE-TERMINATOR) \n c, 0 2r> + c! ( ) ; +: MULTI-LINE-COMMENT ( "comment" -- ) + BEGIN + >in @ ')' parse ( >in c-addr len ) + nip + >in @ = ( delimiter-not-found? ) + WHILE ( ) + refill 0= IF EXIT THEN ( ) + REPEAT + +; + }private \ This treats \n, \r\n, and \r as line terminator. Reading is done @@ -108,4 +118,13 @@ create (LINE-TERMINATOR) \n c, THEN ; +: ( ( "comment" -- ) + source-id + CASE + -1 OF postpone ( ENDOF + 0 OF postpone ( ENDOF + multi-line-comment + ENDCASE +; immediate + privatize