summaryrefslogtreecommitdiff
path: root/lib/sbin/f_file_processor.pl
diff options
context:
space:
mode:
authorschnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac>2008-01-25 16:02:12 +0000
committerschnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac>2008-01-25 16:02:12 +0000
commit9512b832ef3e00b5d382ae77fd9ed00026b72985 (patch)
treea8aae992c827357a6584eec920ef3749949b6778 /lib/sbin/f_file_processor.pl
parent9735fdaf2e6736d4e04e3ff6b9f2bf6a9b73447e (diff)
Don't treat HPF and OMP directives as comments
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4455 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/f_file_processor.pl')
-rw-r--r--lib/sbin/f_file_processor.pl10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/sbin/f_file_processor.pl b/lib/sbin/f_file_processor.pl
index 4601b63d..0a44ac3b 100644
--- a/lib/sbin/f_file_processor.pl
+++ b/lib/sbin/f_file_processor.pl
@@ -35,11 +35,11 @@ $line_directives = $line_directives eq 'yes';
# Pick the correct set of comments to remove.
if ($free_format)
{
- $standard_comments = "\\s*[!]";
+ $standard_comments = "^\\s*!(?!\$(omp|hpf))";
}
else
{
- $standard_comments = "[cC!]";
+ $standard_comments = "^[c!*](?!\$(omp|hpf))";
}
# Maximum line length for free form Fortran
@@ -90,7 +90,7 @@ while (<>)
# Chop Fortran comments to 132 columns (they stay in code)
# removing any quotes
# (standard c C, or even ! comments)
- if (/^$standard_comments.*$/)
+ if (/$standard_comments/i)
{
# Remove quotes
s/['"]//g;
@@ -110,11 +110,11 @@ while (<>)
# the following code by Fokke Dijkstra also checks for comments
# on a line with a string
# Search for possible comment
- if (/!/)
+ if (/!(?!\$(omp|hpf))/)
{
# find all ! " and ' and check for strings or comments
$string = 0;
- while (m/([!"'])/g)
+ while (m/(["'!])/g)
{
# keep track of position for substr include last character
$position = (pos) - 1;