/[bibulus]/bibulus/preproclang
ViewVC logotype

Diff of /bibulus/preproclang

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

revision 1.1 by twid, Fri Apr 18 22:37:06 2003 UTC revision 1.2 by twid, Fri Apr 18 23:11:07 2003 UTC
# Line 1  Line 1 
1  #!/usr/local/bin/perl -w  #!/usr/local/bin/perl -w
2    
3  require 5.008;                  # needed for the :utf8 layer  require 5.008;                  # needed for the :utf8 layer
4    my $old = '';
5    
6  open (OUT, ">:utf8", "lang.pl") or die "Cannot write lang.pl\n";  open (OUT, ">:utf8", "lang.pl") or die "Cannot write lang.pl\n";
7    
# Line 15  foreach (readdir(D)) { Line 16  foreach (readdir(D)) {
16      chomp;      chomp;
17      s/'/\\'/g;      s/'/\\'/g;
18      my @f = split(';');      my @f = split(';');
19      if (@f == 2) {      my @w = split('-', $f[0]);
20        print OUT "    $f[0] => '$f[1]',\n";      if (@w == 1) {
21      } else {        if ($old) {
22        $f[2] =~ /^(!?)(.*)/;          print OUT "    },\n";
23        print OUT "    ($1\$self->{STYLE}{$2}? ($f[0] => '$f[1]'): ()),\n";        }
24          $old = '';
25        } else {   # string like 'edno-1'
26          if ($old ne $w[0]) {
27            print OUT "    },\n" if $old;
28            print OUT "    $w[0] => {\n";
29          }
30          $old = $w[0];
31          $f[0] = $w[1];
32      }      }
33    
34          if (@f == 2) {
35            print OUT "    '$f[0]' => '$f[1]',\n";
36          } else {
37            $f[2] =~ /^(!?)(.*)/;
38            print OUT "    ($1\$self->{STYLE}{$2}? ('$f[0]' => '$f[1]'): ()),\n";
39          }
40    }    }
41    close L;    close L;
42      if ($old) {
43        print OUT "    },\n";
44        $old = '';
45      }
46    print OUT "  },\n";    print OUT "  },\n";
47  }  }
48  close D;  close D;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

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