/[webpac]/branches/lezbib/parse_format.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /branches/lezbib/parse_format.pm

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

revision 457 by dpavlin, Sat Apr 17 22:31:43 2004 UTC revision 458 by dpavlin, Tue Sep 21 16:53:44 2004 UTC
# Line 56  sub parse_iso_format { Line 56  sub parse_iso_format {
56                  my $f = $format;                  my $f = $format;
57    
58                  my $eval;                  my $eval;
59                  $eval = $1 if ($f =~ s/^eval{([^}]+)}//);                  $eval = $1 if ($f =~ s/^eval{([^}]+?)}//);
60    
61                  if ($f =~ s/^([^\d]+)//) {                  if ($f =~ s/^([^\d]+)//) {
62                          if ($f) {       # there is more to parse                          if ($f) {       # there is more to parse
# Line 163  sub parse_iso_format { Line 163  sub parse_iso_format {
163                  sub fld2str {                  sub fld2str {
164                          my ($func,$row,$f,$sf,$i) = @_;                          my ($func,$row,$f,$sf,$i) = @_;
165  #print STDERR "## in fld2str\n";  #print STDERR "## in fld2str\n";
166                          my $tmp = $codepage->convert(&$func($row,$f,$sf,$i)) || '';                          my $tmp = $codepage->convert(&$func($row,$f,$sf,$i)) ||  $codepage->convert(&$func($row,$f,$sf,0)) || '';
167                          return "'$tmp'";                          return "'$tmp'";
168                  }                  }
169    
170                  $eval =~ s/v(\d+)\^(\w*)/fld2str($func,$row,$1,$2,$i)/eg;                  $eval =~ s/v(\d+)\^(\w*)/fld2str($func,$row,$1,$2,$i)/eg;
171  #print STDERR "## eval: $eval\n";  #print STDERR "## eval: $eval\n";
172                  if (eval "$eval") {                  if (eval "$eval") {
173                            die "eval error: eval{$eval}: $@" if ($@);
174                          return ($swish,$display);                          return ($swish,$display);
175                  } else {                  } else {
176                            die "eval error: eval{$eval}: $@" if ($@);
177                          return (undef,undef);                          return (undef,undef);
178                  }                  }
179          }          }

Legend:
Removed from v.457  
changed lines
  Added in v.458

  ViewVC Help
Powered by ViewVC 1.1.26