X-Git-Url: http://git.subgeniuskitty.com/pforth/.git/blobdiff_plain/f9a1c9cea42bd3c290b8823e1ece25a3bc878462..646bd2a85a71d5421c0021f4e37e3cd5849280ec:/fth/file.fth diff --git a/fth/file.fth b/fth/file.fth index b71edc5..8fe0810 100644 --- a/fth/file.fth +++ b/fth/file.fth @@ -61,6 +61,15 @@ 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 +117,14 @@ create (LINE-TERMINATOR) \n c, THEN ; +: ( ( "comment" -- ) + source-id + CASE + -1 OF postpone ( ENDOF + 0 OF postpone ( ENDOF + \ for input from files + multi-line-comment + ENDCASE +; immediate + privatize