blob: 35d2969334398ac56686beb5d69f8a15d56a34d8 (
plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
% eptex
% \Uchar <chr_code>
% 0--255:常に欧文文字トークン
% 256以上の,内部コードで許される値:常に和文文字トークン
% \Ucharcat <chr_code> <catcode>
% <chr_code> in [0,128): 欧文文字トークンを生成.<catcode> in {1..4, 6..8, 10..13}
% <chr_code> in [128,256)
% e-pTeX の場合:欧文文字トークンを生成.<catcode> in {1..4, 6..8, 10..13}
% e-upTeX の場合:欧文/和文文字トークンを生成.<catcode> in {1..4, 6..8, 10..13, 16..19}
% <chr_code> >=256: 和文文字トークンを生成.
% e-pTeX の場合: <catcode> in {16..18}
% e-upTeX の場合:<catcode> in {16..19}
% e-upTeX:
\let\bg={ \let\eg=}
{\catcode`\ =9\relax
\gdef\KCAT{%
\immediate\write17{%
[\expandafter\string\x\space
\expandafter\ifcat\x$ math\space shift\fi
\expandafter\ifcat\x& alignment\fi
\expandafter\ifcat\x^ superscript\fi
\expandafter\ifcat\x_ subscript\fi
\expandafter\ifcat\x\space space\fi
\expandafter\ifcat\x a letter\fi
\expandafter\ifcat\x 1 other\space char\fi
\expandafter\ifcat\x ~ active\fi
\expandafter\ifcat\x 空 kanji\fi
\expandafter\ifcat\x ア kana\fi
\expandafter\ifcat\x { other\space kchar\fi
\ifdefined\ucs
\expandafter\ifcat\x 한 hangul\fi
\fi]}%
}}
\let\sharp=#
\font\x=ec-lmtt10 \x
\scrollmode
\edef\x{\Uchar`\{}\KCAT
\edef\x{\Uchar`\}}\KCAT
\edef\x{\Uchar`\$}\KCAT
\edef\x{\Uchar`\&}\KCAT
\edef\x{\Uchar`\#}\KCAT
\edef\x{\Uchar`\^}\KCAT
\edef\x{\Uchar`\_}\KCAT
\edef\x{\Uchar`\ }\KCAT
\edef\x{\Uchar`\a}\KCAT
\edef\x{\Uchar`\1}\KCAT
\edef\x{\Uchar`~}\KCAT
\edef\x{\Uchar`漢}\KCAT
\edef\x{\Uchar`あ}\KCAT
\edef\x{\Uchar`)}\KCAT
\ifdefined\ucs %======
\immediate\write0{■\string\Uchar\space and \string\kcatcode}
{\kcatcode"03B1=15 \kcatcode"FF=15
\edef\x{\Uchar"FF}\KCAT%"
\edef\x{\Uchar"03B1}\KCAT%"
}
{\kcatcode"03B1=17 \kcatcode"FF=17
\edef\x{\Uchar"FF}\KCAT%"
\edef\x{\Uchar"03B1}\KCAT%"
}
\fi %======
\immediate\write0{■\string\Ucharcat.}
\edef\x{\Ucharcat`\# 0}\KCAT % error "! Invalid code"
\edef\x{\Ucharcat`\# 3}\KCAT
\edef\x{\Ucharcat`\# 4}\KCAT
\edef\x{\Ucharcat`\# 5}\KCAT % error "! Invalid code"
\edef\x{\Ucharcat`\# 7}\KCAT
\edef\x{\Ucharcat`\# 8}\KCAT
\edef\x{\Ucharcat`\# 9}\KCAT % error "! Invalid code"
\edef\x{\Ucharcat`\# 10}\KCAT
\edef\x{\Ucharcat`\# 11}\KCAT
\edef\x{\Ucharcat`\# 12}\KCAT
\edef\x{\unexpanded\expandafter{\Ucharcat`\# 13}}
\message{\expandafter\meaning\unexpanded\expandafter{\x}} % undefined
\edef\x{\Ucharcat`\# 14}\KCAT % error "! Invalid code"
\edef\x{\Ucharcat`\# 15}\KCAT % error "! Invalid code"
\edef\x{\Ucharcat`\# 16} % error "! Invalid code (16)"
\KCAT
\ifdefined\ucs %======
\edef\x{\Ucharcat`漢 3} % error "! Invalid code (3)"
\KCAT
\edef\x{\Ucharcat`$ 16}\KCAT
\edef\x{\Ucharcat`: 17}\KCAT
\edef\x{\Ucharcat`あ 18}\KCAT
\edef\x{\Ucharcat`漢 19}\KCAT
{\kcatcode"03B1=15 %"
\edef\x{\Ucharcat"03B1 12}\KCAT%" error "! Invalid code (12)"
\edef\x{\Ucharcat"03B1 17}\KCAT%"
}
{\kcatcode"03B1=16 %"
\edef\x{\Ucharcat"03B1 12}\KCAT%" error "! Invalid code (12)"
\edef\x{\Ucharcat"03B1 17}\KCAT%"
}
{\kcatcode"FF=15 %"
\edef\x{\Ucharcat"FF 12}\KCAT%"
\edef\x{\Ucharcat"FF 17}\KCAT%"
}
{\kcatcode"FF=16 %"
\edef\x{\Ucharcat"FF 12}\KCAT%"
\edef\x{\Ucharcat"FF 17}\KCAT%"
}
\else
\edef\x{\Ucharcat`漢 3} % error "! Bad character code" in eptex
\fi % ======
\end
|