/[webpac]/trunk/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

Contents of /trunk/parse_format.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10 - (show annotations)
Thu Jan 16 17:35:54 2003 UTC (21 years, 2 months ago) by dpavlin
File size: 987 byte(s)
bunch of changes: make design more modular, implement index (partial
implementation) and other small and big changes

1 #-------------------------------------------------------------
2 #
3 # parse_format('format',$isis_row);
4 #
5
6 use isis_sf;
7
8 sub parse_format {
9 my $format = shift;
10 my $row = shift;
11
12 my $out;
13 my $out_swish;
14
15 my $prefix = "";
16 if ($format =~ s/^([^\d]+)//) {
17 $prefix = "pre: $1";
18 }
19
20 my $display;
21 my $swish;
22
23 while ($format) {
24 #print STDERR "#### $format\n";
25 if ($format =~ s/^(\d\d\d)(\w?)//) {
26 my $isis_tmp = isis_sf($row,$1,$2);
27 if ($isis_tmp) {
28 $display .= $prefix . $isis_tmp;
29 $swish .= $isis_tmp." ";
30 }
31 $prefix = "";
32 } elsif ($format =~ s/^([^\d]+)(\d{0,3})/$2/) {
33 $prefix .= $1;
34 } elsif ($format =~ s/^([^\d]+\d{0,2})//) {
35 $prefix .= $1;
36 } elsif ($format =~ s/^(\d{1,2})//) {
37 $prefix .= $1;
38 } else {
39 print STDERR "unparsed format: $format\n";
40 $prefix .= $format;
41 $format = "";
42 }
43 }
44 # add suffix
45 $display .= $prefix if ($display);
46
47 return ($swish,$display);
48 }
49
50 #-------------------------------------------------------------
51 1;

Properties

Name Value
cvs2svn:cvs-rev 1.1

  ViewVC Help
Powered by ViewVC 1.1.26