Skip to content

Commit

Permalink
ptex-base.ch: re-eval kcatcode of Japanese character token in \if and…
Browse files Browse the repository at this point in the history
… \ifcat (test)
  • Loading branch information
h-kitagawa committed Apr 22, 2019
1 parent bdfba95 commit ea452bc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/texk/web2c/ptexdir/ptex-base.ch
Original file line number Diff line number Diff line change
Expand Up @@ -2540,7 +2540,7 @@ if (cur_cmd>active_char)or(cur_chr>255) then
end;
@y
if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then
begin m:=cur_cmd; n:=cur_chr;
begin n:=cur_chr; m:=kcat_code(kcatcodekey(n));
end
else if (cur_cmd>active_char)or(cur_chr>255) then
begin m:=relax; n:=max_cjk_val;
Expand All @@ -2549,8 +2549,8 @@ else begin m:=cur_cmd; n:=cur_chr;
end;
get_x_token_or_active_char;
if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then
begin cur_cmd:=cur_cmd;
end {dummy}
begin cur_cmd:=kcat_code(kcatcodekey(cur_chr));
end
else if (cur_cmd>active_char)or(cur_chr>255) then
begin cur_cmd:=relax; cur_chr:=max_cjk_val;
end;
Expand Down
9 changes: 9 additions & 0 deletions source/texk/web2c/uptexdir/tests/test_if.tex
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
\kcatcode`あ=18
\def\xA{あ}\let\yA=あ
\kcatcode`あ=17
\def\xB{あ}\let\yB=あ
\kcatcode`あ=16

\message{\ifcat\xA Y\else N\fi}
\message{\ifcat\yA Y\else N\fi}
\message{\ifcat\xB Y\else N\fi}
\message{\ifcat\yB Y\else N\fi}

\message{\if\xA Y\else N\fi}
\message{\if\yA Y\else N\fi}
\message{\if\xA Y\else N\fi}
\message{\if\yA Y\else N\fi}

\ifx\ucs\undefined\else
\kcatcode"100=16
Expand Down
8 changes: 8 additions & 0 deletions source/texk/web2c/uptexdir/uptex-m.ch
Original file line number Diff line number Diff line change
Expand Up @@ -700,16 +700,24 @@ uptex_revision_code: print(upTeX_revision);
@x
if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then
begin n:=cur_chr; m:=kcat_code(kcatcodekey(n));
end
@y
if (cur_cmd>=kanji)and(cur_cmd<=hangul) then
begin m:=cur_cmd; n:=cur_chr;
end
@z
@x
get_x_token_or_active_char;
if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then
begin cur_cmd:=kcat_code(kcatcodekey(cur_chr));
end
@y
get_x_token_or_active_char;
if (cur_cmd>=kanji)and(cur_cmd<=hangul) then
begin cur_cmd:=cur_cmd;
end {dummy}
@z
@x
Expand Down

0 comments on commit ea452bc

Please sign in to comment.