summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHironobu Yamashita <h.y.acetaminophen@gmail.com>2021-06-25 09:14:15 +0000
committerHironobu Yamashita <h.y.acetaminophen@gmail.com>2021-06-25 09:14:15 +0000
commit8d8684458b9d43c49479394b5411f999bfc0f154 (patch)
treed12688c889f06c754541b257886f750830fe5e6b
parent74be7c8354ce18fa150ae5096acb9b01ea56783e (diff)
ptex: no re-eval of kcatcode for \ifcat
git-svn-id: svn://tug.org/texlive/trunk@59699 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/web2c/ptexdir/ChangeLog3
-rw-r--r--Build/source/texk/web2c/ptexdir/ptex-base.ch8
-rw-r--r--Build/source/texk/web2c/uptexdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/uptexdir/tests/test_if.tex55
-rw-r--r--Build/source/texk/web2c/uptexdir/uptex-m.ch8
5 files changed, 53 insertions, 26 deletions
diff --git a/Build/source/texk/web2c/ptexdir/ChangeLog b/Build/source/texk/web2c/ptexdir/ChangeLog
index a0d629e2a54..cf8e1e62b56 100644
--- a/Build/source/texk/web2c/ptexdir/ChangeLog
+++ b/Build/source/texk/web2c/ptexdir/ChangeLog
@@ -6,6 +6,9 @@
* ptex-base.ch (line_break): consider when link(temp_head)=tail
and it is a disp_node.
https://github.com/texjporg/tex-jp-build/issues/123
+ * ptex-base.ch: Partially revert the commit on 2019-05-06;
+ no re-eval kcatcode of Japanese character token in \if and \ifcat.
+ This is because the behavior was inconsistent against \ifx.
2021-03-23 Karl Berry <karl@tug.org>
diff --git a/Build/source/texk/web2c/ptexdir/ptex-base.ch b/Build/source/texk/web2c/ptexdir/ptex-base.ch
index bb45acdb3c1..0cee7df6b36 100644
--- a/Build/source/texk/web2c/ptexdir/ptex-base.ch
+++ b/Build/source/texk/web2c/ptexdir/ptex-base.ch
@@ -2542,7 +2542,7 @@ else begin
end
@z
-@x [28.502] l.10138 - pTeX: ifx : Test character : KANJI character
+@x [28.502] l.10138 - pTeX: if[cat] : Test character : KANJI character
if (cur_cmd>active_char)or(cur_chr>255) then {not a character}
begin m:=relax; n:=256;
end
@@ -2554,7 +2554,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 n:=cur_chr; m:=kcat_code(kcatcodekey(n));
+ begin m:=cur_cmd; n:=cur_chr;
end
else if (cur_cmd>active_char)or(cur_chr>255) then
begin m:=relax; n:=max_cjk_val;
@@ -2563,8 +2563,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:=kcat_code(kcatcodekey(cur_chr));
- end
+ begin cur_cmd:=cur_cmd;
+ end {dummy}
else if (cur_cmd>active_char)or(cur_chr>255) then
begin cur_cmd:=relax; cur_chr:=max_cjk_val;
end;
diff --git a/Build/source/texk/web2c/uptexdir/ChangeLog b/Build/source/texk/web2c/uptexdir/ChangeLog
index 418c58697c3..c1ea8c4ea4e 100644
--- a/Build/source/texk/web2c/uptexdir/ChangeLog
+++ b/Build/source/texk/web2c/uptexdir/ChangeLog
@@ -1,3 +1,8 @@
+2021-06-25 Hironobu Yamashita <h.y.acetaminophen@gmail.com>
+
+ * uptex—m.ch: Adapt to ptex-base.ch for no re-eval.
+ * tests/test_if.tex: Update.
+
2021-03-23 Karl Berry <karl@tug.org>
* TL'21.
diff --git a/Build/source/texk/web2c/uptexdir/tests/test_if.tex b/Build/source/texk/web2c/uptexdir/tests/test_if.tex
index 35588f992c1..ddae745e7fb 100644
--- a/Build/source/texk/web2c/uptexdir/tests/test_if.tex
+++ b/Build/source/texk/web2c/uptexdir/tests/test_if.tex
@@ -1,29 +1,56 @@
+%#!ptex
\kcatcode`あ=18
\def\xA{あ}\let\yA=あ
\kcatcode`あ=17
\def\xB{あ}\let\yB=あ
\kcatcode`あ=16
+\def\xC{あ}\let\yC=あ
-\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}
+%% for pTeX
+% * x: macro -> re-eval kcatcode
+% * y: let -> copy kcatcode
+%% for upTeX
+% * x: macro -> reserved kcatcode
+% * y: let -> copy kcatcode
-\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}
+\message{ifcat}
+\message{\ifcat あ\xA Y\else N\fi}% pY, uN
+\message{\ifcat あ\yA Y\else N\fi}% pN, uN
+\message{\ifcat あ\xB Y\else N\fi}% pY, uN
+\message{\ifcat あ\yB Y\else N\fi}% pN, uN
+\message{\ifcat あ\xC Y\else N\fi}% pY, uY
+\message{\ifcat あ\yC Y\else N\fi}% pY, uY
+
+\message{if}
+\message{\if あ\xA Y\else N\fi}% pY, uY
+\message{\if あ\yA Y\else N\fi}% pY, uY
+\message{\if あ\xB Y\else N\fi}% pY, uY
+\message{\if あ\yB Y\else N\fi}% pY, uY
+\message{\if あ\xC Y\else N\fi}% pY, uY
+\message{\if あ\yC Y\else N\fi}% pY, uY
+\message{\if い\xA Y\else N\fi}% pN, uN
+\message{\if い\yA Y\else N\fi}% pN, uN
+
+\message{ifx}
+\message{\ifx あ\xA Y\else N\fi}% pN, uN
+\message{\ifx あ\yA Y\else N\fi}% pN, uN
+\message{\ifx あ\xB Y\else N\fi}% pN, uN
+\message{\ifx あ\yB Y\else N\fi}% pN, uN
+\message{\ifx あ\xC Y\else N\fi}% pN, uN
+\message{\ifx あ\yC Y\else N\fi}% pY, uY
+\message{\ifx \xA\xB Y\else N\fi}% pY, uN
+\message{\ifx \xA\xC Y\else N\fi}% pY, uN
+\message{\ifx \yA\yB Y\else N\fi}% pN, uN
+\message{\ifx \yA\yC Y\else N\fi}% pN, uN
\ifx\ucs\undefined\else
\kcatcode"100=16
\message{upTeX}
\def\xA{Ā}% U+0100
\def\xB{ā}% U+0101
- \message{\if \xA\relax Y\else N\fi}
- \message{\if \xB\relax Y\else N\fi}
- \message{\ifcat\xA\relax Y\else N\fi}
- \message{\ifcat\xB\relax Y\else N\fi}
+ \message{\if \xA\relax Y\else N\fi}% uN
+ \message{\if \xB\relax Y\else N\fi}% uN
+ \message{\ifcat\xA\relax Y\else N\fi}% uN
+ \message{\ifcat\xB\relax Y\else N\fi}% uN
\fi
\end
-
-
diff --git a/Build/source/texk/web2c/uptexdir/uptex-m.ch b/Build/source/texk/web2c/uptexdir/uptex-m.ch
index 78f830cb897..780f83a9e38 100644
--- a/Build/source/texk/web2c/uptexdir/uptex-m.ch
+++ b/Build/source/texk/web2c/uptexdir/uptex-m.ch
@@ -704,24 +704,16 @@ 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