/[libconf]/libconf/perl-Libconf/Libconf.pm
ViewVC logotype

Diff of /libconf/perl-Libconf/Libconf.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18 by chl, Mon Apr 21 18:58:30 2003 UTC revision 1.19 by dams, Mon Apr 21 19:10:18 2003 UTC
# Line 258  sub parse { Line 258  sub parse {
258      my @out_atoms;      my @out_atoms;
259      my $keep_atom;      my $keep_atom;
260      $out->{current_sections} ||= [];      $out->{current_sections} ||= [];
261        my $line_idx = 1;
262      foreach my $in (@file) {      foreach my $in (@file) {
263          $out_atoms[$item] ||= {};          $out_atoms[$item] ||= {};
264          $in eq "\n" and $out_atoms[$item]->{comments} .= " \n", next;          $in eq "\n" and $out_atoms[$item]->{comments} .= " \n", next;
# Line 313  sub parse { Line 314  sub parse {
314              $matched and last;              $matched and last;
315          }          }
316  #       validate($out, $out_atoms[$item]);  #       validate($out, $out_atoms[$item]);
317          $in !~ /^\s*$/ and push @{$out_atoms[$item]->{invalid}}, $in and print "Libconf.pm warning: can't parse line :\n$in\n";          if ($in !~ /^\s*$/){
318                push @{$out_atoms[$item]->{invalid}}, $in;
319                print "\nLibconf.pm warning: can't parse line n°" . $line_idx . " :\n$in\n";
320            }
321          $keep_atom or $item++;          $keep_atom or $item++;
322  #       if (!$keep_atom) {  #       if (!$keep_atom) {
323  #           $item++;  #           $item++;
324  #           $next_item = 0;  #           $next_item = 0;
325  #       }  #       }
326        } continue {
327            $line_idx++;
328      }      }
329      $out->{atoms} = [@out_atoms];      $out->{atoms} = [@out_atoms];
330  }  }

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26