summaryrefslogtreecommitdiff
path: root/lib/sbin/f_file_processor.pl
diff options
context:
space:
mode:
authorallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2002-08-16 18:32:29 +0000
committerallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2002-08-16 18:32:29 +0000
commit9fe3bcea1046951dac7111cb87eb02e40a670b50 (patch)
treee7e74a34d872f12e022f85cd2656ff67381015ee /lib/sbin/f_file_processor.pl
parent6a06f9bc4ffff24ada833f2f4d0bc12926be8bab (diff)
Don't remove the fortran comments (which start with a c,C or ! in the first
column) during pre-processing. This is to allow machine optimisations which are inserted in comments to be used. git-svn-id: http://svn.cactuscode.org/flesh/trunk@2955 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/f_file_processor.pl')
-rw-r--r--lib/sbin/f_file_processor.pl53
1 files changed, 30 insertions, 23 deletions
diff --git a/lib/sbin/f_file_processor.pl b/lib/sbin/f_file_processor.pl
index c8a206d4..31f8d589 100644
--- a/lib/sbin/f_file_processor.pl
+++ b/lib/sbin/f_file_processor.pl
@@ -66,32 +66,39 @@ while (<>)
# Get rid of any tabs
s/\t/ /g;
- # Get rid of standard c C, or even ! comments
- s/^$standard_comments.*$/\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.
- # since there is a different case if the thing matches a newline
- # than if it doesn't.
- if (/\n/)
+ # Ignore some fortran comments (they stay in code)
+ # (standard c C, or even ! comments)
+ if (/^$standard_comments.*$/ || /(.)![^'"]*$/)
{
- foreach $LINE (split('\n',$_))
- {
- &splitline($LINE);
- }
+ print;
+ print "\n";
}
- else
+ else
{
- &splitline($_);
+ # 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.
+ # since there is a different case if the thing matches a newline
+ # than if it doesn't.
+ if (/\n/)
+ {
+ foreach $LINE (split('\n',$_))
+ {
+ &splitline($LINE);
+ }
+ }
+ else
+ {
+ &splitline($_);
+ }
}
}