summaryrefslogtreecommitdiff
path: root/lib/sbin/parameter_parser.pl
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-12-17 14:07:51 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-12-17 14:07:51 +0000
commit5c652eb4edf92f6878afc8bdc9067a7ecc95ea2e (patch)
treeb7a5d6026860a0eff83eaaec9c14b00a7627f084 /lib/sbin/parameter_parser.pl
parent0a321611e5beb1816245f5e45ad94731623b86ae (diff)
Removed ability to use deprecated LOGICAL.
Removed necessity for range with some USES - still need {} , 'though. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@1965 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/parameter_parser.pl')
-rw-r--r--lib/sbin/parameter_parser.pl16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/sbin/parameter_parser.pl b/lib/sbin/parameter_parser.pl
index 521ee3fd..9d7c3aad 100644
--- a/lib/sbin/parameter_parser.pl
+++ b/lib/sbin/parameter_parser.pl
@@ -109,6 +109,7 @@ sub parse_param_ccl
my($data, %parameter_db);
my(%friends);
my(%defined_parameters);
+ my($use_clause);
# The default block is private.
@@ -144,9 +145,8 @@ sub parse_param_ccl
$parameter_db{"\U$thorn $block\E variables"} = "";
}
}
- elsif($line =~ m:(EXTENDS |USES )?\s*(?\:CCTK_)?(INT|REAL|LOGICAL|BOOLEAN|KEYWORD|STRING)\s*([a-zA-Z]+[a-zA-Z0-9_]*) \s*(\"[^\"]*\")\s*(.*)$:i)
+ elsif($line =~ m:(EXTENDS |USES )?\s*(?\:CCTK_)?(INT|REAL|BOOLEAN|KEYWORD|STRING)\s*([a-zA-Z]+[a-zA-Z0-9_]*) \s*(\"[^\"]*\")\s*(.*)$:i)
{
-
# This is a parameter definition.
$type = "\U$2\E";
@@ -154,10 +154,13 @@ sub parse_param_ccl
$description = $4;
$options = $5;
- # Logical is depricated
- if ($type =~ /LOGICAL/i)
+ if($1 =~ m:USES:i)
{
- $type =~ s/LOGICAL/BOOLEAN/gi;
+ $use_clause = 1;
+ }
+ else
+ {
+ $use_clause = 0;
}
if($defined_parameters{"\U$variable\E"})
@@ -176,7 +179,6 @@ sub parse_param_ccl
$line_number++ until ($data[$line_number] =~ m:\}:);
}
elsif($data[$line_number+1] !~ m:^\s*\{\s*$:)
-
{
# Since the data should have no blank lines, the next
# line should have { on it.
@@ -253,7 +255,7 @@ sub parse_param_ccl
}
# Give a warning if no range was given and it was needed
- if ($parameter_db{"\U$thorn $variable\E ranges"}==0 && $type =~ m:INT|REAL:)
+ if ((! $use_clause) && ($parameter_db{"\U$thorn $variable\E ranges"}==0 && $type =~ m:INT|REAL:))
{
$message = "No range given for $variable in $thorn";
&CST_error(0,$message,__LINE__,__FILE__);