home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-01-26 | 585 b | 23 lines | [TEXT/KEEN] |
- #$StringCommentAlign
- #-input from lines in a string array, of the form
- # "string", /*comment*/
- #one entry per line. Nudge comments to line them up nicely.
-
- {
- match($0, /".*,/)
- one[++n] = substr($0, RSTART, RLENGTH)
- match($0, /\/\*.*\*\//)
- two[n] = substr($0, RSTART, RLENGTH)
-
- if (w1 < length(one[n]))
- w1 = length(one[n])
- if (w2 < length(two[n]))
- w2 = length(two[n])
-
- }
- END {w1 += 2; w2 += 2;#a couple of spaces between columns
- for (i = 1; i <= n; ++i)
- ##printf "%-" w1 "s" "%-" w2 "s\n", one[i], two[i]
- printf "%-" w1 "s" "%-s\n", one[i], two[i]
- }
-