summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-11-24 14:05:13 +0000
committerallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-11-24 14:05:13 +0000
commitdb54e98c4d21f26bded1add924813d76f59b3d60 (patch)
tree4ae8807fe35f895618845a3d682882cfa33aca5f /lib
parente189d714bc19b81ca935fe4eb5b1a3d569ee0765 (diff)
Remove comments before adding line breaks
Fix for Cactus/171 git-svn-id: http://svn.cactuscode.org/flesh/trunk@1167 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib')
-rw-r--r--lib/sbin/f_file_processor.pl12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/sbin/f_file_processor.pl b/lib/sbin/f_file_processor.pl
index e4bbe525..bbabbd2d 100644
--- a/lib/sbin/f_file_processor.pl
+++ b/lib/sbin/f_file_processor.pl
@@ -6,6 +6,7 @@
#
# Reads STDIN, writes to STDOUT.
#
+# removes all comments
# replaces && with newline and tab to col 7
# replaces &! with newline at col 0
# Breaks lines greater than 72 cols
@@ -15,7 +16,7 @@
# Joan, Apr 21 1997: get rid of cC comments and handle ! comments properly
# and fix it so now it is really 72 and we do not get
# shitty breaks in the middle of fortran strings!
-#
+
$* = 1; # Multi-line is on!
while (<>) {
@@ -31,16 +32,17 @@ while (<>) {
# Get rid of any tabs
s/\t/ /g;
- # OK, now put in the line breaks:
- s/\&\&\s*/\n /g;
- s/\&\!\s*/\n/g;
-
# Get rid of standard c C, or even ! comments
s/^[cC!].*$/\n/g;
# Get rid of ! comments : a bit tricky as ! may appear inside strings
s/(.)![^'"]*$/\1\n/g;
+ # OK, now put in the line breaks (&& or &!)
+ s/\&\&\s*/\n /g;
+ s/\&\!\s*/\n/g;
+
+ # Get rid of lonesome semicolons
s/\s*\;\s*$//;
# And now we can fix the lines. This is actually a little complicated.