home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v941.tgz / icon.v941src.tar / icon.v941src / ipl / progs / ibar.icn < prev    next >
Text File  |  2000-07-29  |  908b  |  36 lines

  1. ############################################################################
  2. #
  3. #    File:     ibar.icn
  4. #
  5. #    Subject:  Program to equalize comment bars in Icon programs
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     June 8, 1994
  10. #
  11. ############################################################################
  12. #
  13. #   This file is in the public domain.
  14. #
  15. ############################################################################
  16. #
  17. #  This program replaces comment bars in Icon programs by bars 76 characters
  18. #  long -- the program library standard.
  19. #
  20. ############################################################################
  21.  
  22. procedure main()
  23.    local bar, short_bar, line, notcom
  24.  
  25.    bar := repl("#", 76)
  26.    short_bar := repl("#", 60)
  27.    notcom := ~'#'
  28.  
  29.    while line := read() do
  30.       line ? {
  31.          if =short_bar & not(upto(notcom)) & *line ~= 76 then write(bar)
  32.          else write(line)
  33.          }
  34.  
  35. end
  36.