(%.tab): Fix previous change.
[m17n/m17n-db.git] / NAME.awk
1 BEGIN {
2   FS = ";";
3   from = -1;
4   name = "";
5 }
6
7 # For these lines:
8 #   3400;<CJK Ideograph Extension A, First>;Lo;0;L;;;;;N;;;;;
9 #   4DB5;<CJK Ideograph Extension A, Last>;Lo;0;L;;;;;N;;;;;
10 /, First>/ {
11   from = $1; 
12   split ($2, a, "[<,]");
13   getline;
14   print "0x"from"-0x"$1, a[2];
15   from = -1;
16   next;
17 }
18
19 # For succeeding same names.
20 /CJK COMPATIBILITY IDEOGRAPH|<control>/ {
21   if (from < 0)
22     {
23       from = $1;
24       if ($2 ~ "CJK")
25         name = "CJK COMPATIBILITY IDEOGRAPH";
26       else
27         name = "control";
28     }
29   to = $1;
30   next;
31 }
32
33 # For normal names.
34 {
35   if (from >= 0)
36     {
37       print "0x"from"-0x"to, name;
38       from = -1;
39     }
40   print "0x"$1, $2;
41 }
42
43 END {
44   if (from >= 0)
45     print "0x"from"-0x"to, name;
46 }