diff options
author | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-12-17 10:48:18 +0000 |
---|---|---|
committer | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-12-17 10:48:18 +0000 |
commit | a9e2a0493c4b3d8c7890dd6bfd96399d2ee359d3 (patch) | |
tree | 226ac97b80c2ce3c68bcce436862359e571fe485 /lib/sbin/parameter_parser.pl | |
parent | 45eb0db67b825b87b82a66d3c8485ff11b7a64a5 (diff) |
Cactus/427
Check that parameter range descriptions are surrounded by quotes
Give a warning if :: is used and no description is given
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1961 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/parameter_parser.pl')
-rw-r--r-- | lib/sbin/parameter_parser.pl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/sbin/parameter_parser.pl b/lib/sbin/parameter_parser.pl index 01ff6b2d..521ee3fd 100644 --- a/lib/sbin/parameter_parser.pl +++ b/lib/sbin/parameter_parser.pl @@ -228,7 +228,6 @@ sub parse_param_ccl { ($new_ranges, $delim, $new_desc) = ($data[$line_number],"",""); } - # Increment the number of ranges found (ranges) $parameter_db{"\U$thorn $variable\E ranges"}++; # Strip out any spaces in the range for a numeric parameter. @@ -237,12 +236,18 @@ sub parse_param_ccl $new_ranges =~ s/[ \t]+/ /g; } $parameter_db{"\U$thorn $variable\E range $parameter_db{\"\U$thorn $variable\E ranges\"} range"} = $new_ranges; - # Give a warning if no description has been given - if($delim eq "") + + # Check description + if($delim eq "" || ($delim =~ /::/ && $new_desc =~ /^\s*$/)) { $message = "Missing description of range '$new_ranges' for parameter $thorn\::$variable"; &CST_error(1,$message,__LINE__,__FILE__); } + elsif ($new_desc !~ /^\s*\".*\"\s*$/) + { + $message = "Description of range for $thorn\::$variable has misplaced quotes ($new_desc)"; + &CST_error(0,$message,__LINE__,__FILE__); + } $parameter_db{"\U$thorn $variable\E range $parameter_db{\"\U$thorn $variable\E ranges\"} description"} = $new_desc; $line_number++; } |