File: make-inp-rules.pl

package info (click to toggle)
xindy 2.3-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 51,492 kB
  • ctags: 16,667
  • sloc: lisp: 82,455; ansic: 43,027; xml: 25,207; asm: 22,166; sh: 20,913; perl: 15,725; fortran: 6,951; makefile: 3,644; cpp: 2,636; lex: 503; sed: 97
file content (31 lines) | stat: -rw-r--r-- 700 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/perl

print <<"EOF";
;; this file was generated by make-inp-rules.pl
;; these rules map inputenc generated macros (back) to 8-bit characters

EOF


while (<STDIN>) {
  if (/\\indexentry{(.+)--([8-9a-f][0-9a-f])\}\{1\}/) {
    if (!($1 =~ /inputenc Error/)) {
      $i = hex($2);
      $macro = $1;
      $macro =~ s/\~/~~/g;
      $macro =~ s/\"/~\"/g;
      printf("(merge-rule \"%s\" \"%c\" :string)\n",
        $macro, $i);
      if (@ARGV[0] eq "cyracc" &&
        $macro =~ /(cyra |cyre |cyri |cyro |cyru |cyrerev |cyryu |cyrya )/i) {
        printf("(merge-rule \"\\'{%s}\" \"\\'%c\" :string)\n",
          $macro, $i);
      }
    }
  }
}

print <<"EOF";

;; end of style file.
EOF