summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfields_t <oth3r1if3@users.noreply.github.com>2004-03-20 18:58:41 +0000
committerfields_t <oth3r1if3@users.noreply.github.com>2004-03-20 18:58:41 +0000
commit03c55cc5543705cff0bd5b78c58f425f7a4820a8 (patch)
treed9900557fe662ed22a6cdb45c7aa30afc524b4dc
parent7ed064c11d7743f381955dae4c05eab305267b58 (diff)
downloadMPC-unlabeled-1.5.18.tar.gz
Fri Mar 19 15:35:27 MST 2004 Trevor Fields <fields_t@ociweb.com>unlabeled-1.5.18
-rw-r--r--modules/TemplateInputReader.pm30
1 files changed, 7 insertions, 23 deletions
diff --git a/modules/TemplateInputReader.pm b/modules/TemplateInputReader.pm
index 3dbd7d4f..5fe84b8f 100644
--- a/modules/TemplateInputReader.pm
+++ b/modules/TemplateInputReader.pm
@@ -45,7 +45,7 @@ sub parse_line {
my($ih) = shift;
my($line) = shift;
my($status) = 1;
- my($errorString) = '';
+ my($errorString) = undef;
my($current) = $self->{'current'};
if ($line eq '') {
@@ -67,7 +67,7 @@ sub parse_line {
}
else {
$status = 0;
- $errorString = 'ERROR: Unmatched curly brace';
+ $errorString = 'Unmatched curly brace';
}
}
elsif ($line =~ /^(\w+)\s*(\+=|=)\s*(.*)?/) {
@@ -79,28 +79,12 @@ sub parse_line {
$value = $self->create_array($value);
}
else {
- $value = '';
+ $value = [];
}
if ($op eq '+=') {
- my($ref) = $$current[$self->{'cindex'}]->{$name};
- if (defined $ref) {
- if (UNIVERSAL::isa($ref, 'ARRAY')) {
- if (UNIVERSAL::isa($value, 'ARRAY')) {
- push(@$ref, @$value);
- }
- else {
- push(@$ref, $value);
- }
- }
- else {
- if (UNIVERSAL::isa($value, 'ARRAY')) {
- $$current[$self->{'cindex'}]->{$name} .= " @$value";
- }
- else {
- $$current[$self->{'cindex'}]->{$name} .= $value;
- }
- }
+ if (defined $$current[$self->{'cindex'}]->{$name}) {
+ push(@{$$current[$self->{'cindex'}]->{$name}}, @$value);
}
else {
$$current[$self->{'cindex'}]->{$name} = $value;
@@ -112,7 +96,7 @@ sub parse_line {
}
else {
$status = 0;
- $errorString = "ERROR: Redifinition of '$name'";
+ $errorString = "Redifinition of '$name'";
}
}
}
@@ -126,7 +110,7 @@ sub parse_line {
}
else {
$status = 0;
- $errorString = "ERROR: Unrecognized line: $line";
+ $errorString = "Unrecognized line: $line";
}
return $status, $errorString;