home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / FFA.ZIP / COMMENT.SEQ < prev    next >
Encoding:
Text File  |  1988-01-11  |  1.6 KB  |  54 lines

  1. \ COMMENT.SEQ   Allow multiple line comments in files.  by Tom Zimmer
  2.  
  3. : <comment:>    ( --- )
  4.                 bl word 1+ " comment;" caps-comp 0=
  5.                 if      ['] <run> is run
  6.                 then    [compile] \ ;
  7.  
  8. : comment:      ( --- )         \ ignore all lines between.
  9.                 [compile] \
  10.                 ['] <comment:> is run ;
  11.  
  12. : <.comment:>   ( --- )
  13.                 bl word 1+ " comment;" caps-comp 0=
  14.                 if      ['] <run> is run
  15.                 else    key? 0=
  16.                         if      cr tib span @ 78 min type
  17.                         then
  18.                 then    [compile] \ ;
  19.  
  20. : .comment:     ( --- )         \ ignore all lines between.
  21.                 [compile] \
  22.                 ['] <.comment:> is run ;
  23.  
  24. comment: <- this marks the start line of a multi line comment.
  25.  
  26.         this is a comment line somewhere in the middle.
  27.  
  28. comment; <- this marks the end line of a multi line comment.
  29.  
  30. : <#if>         ( --- )
  31.                 bl word 1+ " #endif" caps-comp 0=
  32.                 if      ['] <run> is run
  33.                 then    [compile] \ ;
  34.  
  35. : #if           ( --- )         \ ignore all lines between.
  36.                 [compile] \
  37.                 if      exit
  38.                 then    ['] <#if> is run ;
  39.  
  40. : #endif ;      \ just a noop for the #if TRUE case.
  41.  
  42. comment:
  43.  
  44. true    #if     True flag passed, this comment needs no preceeding \
  45.             cr .( This statment printed due to TRUE flag in #IF statment.)
  46.         #endif
  47.  
  48. false   #if
  49.             .( This statment NOT printed due to FALSE flag in #IF statment.)
  50.         #endif
  51.  
  52. comment;
  53.  
  54.