summaryrefslogtreecommitdiff
path: root/ipl/progs/ibar.icn
blob: be469d78d22335a7feb86feb8e1098c87e3f48dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
############################################################################
#
#	File:     ibar.icn
#
#	Subject:  Program to equalize comment bars in Icon programs
#
#	Author:   Ralph E. Griswold
#
#	Date:     June 8, 1994
#
############################################################################
#
#   This file is in the public domain.
#
############################################################################
#
#  This program replaces comment bars in Icon programs by bars 76 characters
#  long -- the program library standard.
#
############################################################################

procedure main()
   local bar, short_bar, line, notcom

   bar := repl("#", 76)
   short_bar := repl("#", 60)
   notcom := ~'#'

   while line := read() do
      line ? {
         if =short_bar & not(upto(notcom)) & *line ~= 76 then write(bar)
         else write(line)
         }

end