blob: 8c2a909e95a0e6ad7cff57b7b95343660593df86 (
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
|
@x
cur_tok := (cur_cmd*@'400)+cur_chr;
@y
cur_tok := (cur_cmd*max_char_val)+cur_chr;
@z
@x
@d pdf_last_x_pos_code=eptex_version_code+1 {code for \.{\\pdflastxpos}}
@y
@d uptex_version_code=eptex_version_code+1 {code for \.{\\uptexversion}}
@d pdf_last_x_pos_code=uptex_version_code+1 {code for \.{\\pdflastxpos}}
@z
@x
@d uptex_version_code=ptex_minor_version_code+2 {code for \.{\\uptexversion}}
@y
@z
@x
if (cc=not_cjk) then cc:=other_kchar;
@y
if cat>=kanji then cc:=cat else if (cc=not_cjk) then cc:=other_kchar;
@z
@x
else if (t=" ")and(cat=0) then t:=space_token
else if (cat=0)or(cat>=kanji) then t:=other_token+t
else if cat=active_char then t:= cs_token_flag + active_base + t
else t:=left_brace_token*cat+t;
@y
if (t=" ")and(cat=0) then t:=space_token
else if (cat=0)or(cat>=kanji) then t:=other_token+t
else if cat=active_char then t:= cs_token_flag + active_base + t
else t:=left_brace_token*cat+t;
@z
@x
@d illegal_Ucharcat_wchar_catcode(#)==(#<kanji)or(#>other_kchar)
@y
@d illegal_Ucharcat_wchar_catcode(#)==(#<kanji)or(#>hangul)
@z
@x
Uchar_convert_code: scan_char_num;
Ucharcat_convert_code:
begin
scan_ascii_num;
@y
Uchar_convert_code: begin scan_char_num;
if not is_char_ascii(cur_val) then
if kcat_code(kcatcodekey(cur_val))=not_cjk then cat:=other_kchar;
end;
Ucharcat_convert_code:
begin
scan_char_num;
@z
@x
if illegal_Ucharcat_ascii_catcode(cur_val) then
begin print_err("Invalid code ("); print_int(cur_val);
@.Invalid code@>
print("), should be in the ranges 1..4, 6..8, 10..13");
help1("I'm going to use 12 instead of that illegal code value.");@/
error; cat:=12;
end else cat:=cur_val;
@y
if i<=@"7F then { no |wchar_token| }
begin if illegal_Ucharcat_ascii_catcode(cur_val) then
begin print_err("Invalid code ("); print_int(cur_val);
@.Invalid code@>
print("), should be in the ranges 1..4, 6..8, 10..13");
help1("I'm going to use 12 instead of that illegal code value.");@/
error; cat:=12;
end else cat:=cur_val;
end else if i<=@"FF then
begin if (illegal_Ucharcat_ascii_catcode(cur_val))
and (illegal_Ucharcat_wchar_catcode(cur_val)) then
begin print_err("Invalid code ("); print_int(cur_val);
@.Invalid code@>
print("), should be in the ranges 1..4, 6..8, 10..13, 16..19");
help1("I'm going to use 12 instead of that illegal code value.");@/
error; cat:=12;
end else cat:=cur_val;
end else { |wchar_token| only }
begin if illegal_Ucharcat_wchar_catcode(cur_val) then
begin print_err("Invalid code ("); print_int(cur_val);
@.Invalid code@>
print("), should be in the ranges 16..19");
help1("I'm going to use 18 instead of that illegal code value.");@/
error; cat:=other_kchar;
end else cat:=cur_val;
end;
@z
@x
procedure print_kanji(@!s:integer); {prints a single character}
begin
if s>@"FF then begin
if isprint_utf8 then begin
s:=UCStoUTF8(toUCS(s));
if BYTE1(s)<>0 then print_char(@"100+BYTE1(s));
if BYTE2(s)<>0 then print_char(@"100+BYTE2(s));
if BYTE3(s)<>0 then print_char(@"100+BYTE3(s));
print_char(@"100+BYTE4(s));
end
else begin print_char(@"100+Hi(s)); print_char(@"100+Lo(s)); end;
end
else print_char(s);
end;
@y
procedure print_kanji(@!s:KANJI_code); {prints a single character}
begin
if isprint_utf8 then s:=UCStoUTF8(toUCS(s mod max_cjk_val))
else s:=toBUFF(s mod max_cjk_val);
if BYTE1(s)<>0 then print_char(@"100+BYTE1(s));
if BYTE2(s)<>0 then print_char(@"100+BYTE2(s));
if BYTE3(s)<>0 then print_char(@"100+BYTE3(s));
print_char(@"100+BYTE4(s));
end;
@z
|