Subversion Repositories gelsvn

Rev

Rev 107 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 107 Rev 217
Line 9... Line 9...
9
# ************************************************************
9
# ************************************************************
10
# Pragmas
10
# Pragmas
11
# ************************************************************
11
# ************************************************************
12
 
12
 
13
use strict;
13
use strict;
14
use File::Basename;
-
 
15
 
14
 
16
use Parser;
15
use Parser;
17
 
16
 
18
use vars qw(@ISA);
17
use vars qw(@ISA);
19
@ISA = qw(Parser);
18
@ISA = qw(Parser);
Line 37... Line 36...
37
      my($status, $warn) = $self->cached_file_read($f);
36
      my($status, $warn) = $self->cached_file_read($f);
38
      if (!$status) {
37
      if (!$status) {
39
        ## We only want to warn the user about problems
38
        ## We only want to warn the user about problems
40
        ## with the feature file.
39
        ## with the feature file.
41
        my($lnumber) = $self->get_line_number();
40
        my($lnumber) = $self->get_line_number();
42
        $self->warning(basename($f) . ": line $lnumber: $warn");
41
        $self->warning($self->mpc_basename($f) . ": line $lnumber: $warn");
43
      }
42
      }
44
    }
43
    }
45
  }
44
  }
46
 
45
 
47
  ## Process each feature definition
46
  ## Process each feature definition
Line 66... Line 65...
66
  my($error)  = undef;
65
  my($error)  = undef;
67
 
66
 
68
  if ($line eq '') {
67
  if ($line eq '') {
69
  }
68
  }
70
  elsif ($line =~ /^(\w+)\s*=\s*(\d+)$/) {
69
  elsif ($line =~ /^(\w+)\s*=\s*(\d+)$/) {
71
    $self->{'values'}->{$1} = $2;
70
    $self->{'values'}->{lc($1)} = $2;
72
  }
71
  }
73
  else {
72
  else {
74
    $status = 0;
73
    $status = 0;
75
    $error  = "Unrecognized line: $line";
74
    $error  = "Unrecognized line: $line";
76
  }
75
  }
77
 
76
 
78
  return $status, $error;
77
  return $status, $error;
79
}
78
}
80
 
79
 
81
 
80
 
-
 
81
sub get_names {
-
 
82
  my($self)  = shift;
-
 
83
  my(@names) = keys %{$self->{'values'}};
-
 
84
  return \@names;
-
 
85
}
-
 
86
 
-
 
87
 
82
sub get_value {
88
sub get_value {
83
  my($self) = shift;
89
  my($self) = shift;
84
  my($tag)  = shift;
90
  my($tag)  = shift;
85
  return $self->{'values'}->{$tag};
91
  return $self->{'values'}->{lc($tag)};
86
}
92
}
87
 
93
 
88
 
94
 
89
1;
95
1;