summary |
tags |
clone url |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f9a1c9c)
* fth/file.fth ((): Redefine.
(MULTI-LINE-COMMENT): New helper.
* fth/t_file.fth: Uncomment test for multi line comments.
+: MULTI-LINE-COMMENT ( "comment<rparen>" -- )
+ 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
}private
\ This treats \n, \r\n, and \r as line terminator. Reading is done
+: ( ( "comment<rparen>" -- )
+ source-id
+ CASE
+ -1 OF postpone ( ENDOF
+ 0 OF postpone ( ENDOF
+ multi-line-comment
+ ENDCASE
+; immediate
+
T{ FN2 DELETE-FILE 0= -> FALSE }T
\ ----------------------------------------------------------------------------
T{ FN2 DELETE-FILE 0= -> FALSE }T
\ ----------------------------------------------------------------------------
-\ TESTING multi-line ( comments
-\
-\ T{ ( 1 2 3
-\ 4 5 6
-\ 7 8 9 ) 11 22 33 -> 11 22 33 }T
-\
+TESTING multi-line ( comments
+
+T{ ( 1 2 3
+4 5 6
+7 8 9 ) 11 22 33 -> 11 22 33 }T
+
\ ----------------------------------------------------------------------------
TESTING SOURCE-ID (can only test it does not return 0 or -1)
\ ----------------------------------------------------------------------------
TESTING SOURCE-ID (can only test it does not return 0 or -1)