texlive[65228] Build/source/texk/web2c/uptexdir: uptex: fix issue

commits+takuji at tug.org commits+takuji at tug.org
Fri Dec 9 13:04:04 CET 2022


Revision: 65228
          http://tug.org/svn/texlive?view=revision&revision=65228
Author:   takuji
Date:     2022-12-09 13:04:03 +0100 (Fri, 09 Dec 2022)
Log Message:
-----------
uptex: fix issue related to \char, \kchar (by H.Kitagawa)

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/uptexdir/ChangeLog
    trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch

Modified: trunk/Build/source/texk/web2c/uptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/ChangeLog	2022-12-09 00:51:38 UTC (rev 65227)
+++ trunk/Build/source/texk/web2c/uptexdir/ChangeLog	2022-12-09 12:04:03 UTC (rev 65228)
@@ -1,3 +1,9 @@
+2022-12-09  Hironori Kitagawa  <h_kitagawa2001 at yahoo.co.jp>
+
+	* uptex-m.ch: Add kcatcode to a character which is made
+	by \char and \kchar.
+	https://github.com/texjporg/tex-jp-build/issues/103
+
 2022-12-03  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 
 	* up{bibtex,dvitype,pltotf,tftopl}.ch, am/uptex.am:

Modified: trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch	2022-12-09 00:51:38 UTC (rev 65227)
+++ trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch	2022-12-09 12:04:03 UTC (rev 65228)
@@ -46,6 +46,7 @@
 % (2020-10-25) TTK  upTeX u1.27
 % (2022-01-23) TTK  upTeX u1.28
 % (2022-07-23) TTK  upTeX u1.29
+% (2022-12-09) HK   Hironori Kitagawa fixed a bug in \char, \kchar.
 
 @x upTeX: banner
   {printed when \pTeX\ starts}
@@ -801,13 +802,18 @@
    (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar)or
    (cur_cmd=char_given)or(cur_cmd=char_num) then cancel_boundary:=true;
 @y
-hmode+kanji,hmode+kana,hmode+other_kchar,hmode+hangul,hmode+kchar_given: goto main_loop_j;
+hmode+kanji,hmode+kana,hmode+other_kchar,hmode+hangul: goto main_loop_j;
+hmode+kchar_given:
+  begin cur_cmd:=kcat_code(kcatcodekey(cur_chr)); goto main_loop_j; end;
 hmode+char_given:
-  if check_echar_range(cur_chr) then goto main_loop else goto main_loop_j;
+  if check_echar_range(cur_chr) then goto main_loop
+  else begin cur_cmd:=kcat_code(kcatcodekey(cur_chr)); goto main_loop_j; end;
 hmode+char_num: begin scan_char_num; cur_chr:=cur_val;
-  if check_echar_range(cur_chr) then goto main_loop else goto main_loop_j;
+  if check_echar_range(cur_chr) then goto main_loop
+  else begin cur_cmd:=kcat_code(kcatcodekey(cur_chr)); goto main_loop_j; end;
   end;
 hmode+kchar_num: begin scan_char_num; cur_chr:=cur_val;
+  cur_cmd:=kcat_code(kcatcodekey(cur_chr));
   goto main_loop_j;
   end;
 hmode+no_boundary: begin get_x_token;
@@ -847,10 +853,10 @@
 if cur_cmd=other_char then goto main_loop_lookahead+1;
 if cur_cmd=char_given then
   begin if check_echar_range(cur_chr) then goto main_loop_lookahead+1
-  else @<goto |main_lig_loop|@>;
+  else begin cur_cmd:=kcat_code(kcatcodekey(cur_chr)); @<goto |main_lig_loop|@>; end;
   end;
 if cur_cmd=kchar_given then
-  @<goto |main_lig_loop|@>;
+  begin cur_cmd:=kcat_code(kcatcodekey(cur_chr)); @<goto |main_lig_loop|@>; end;
 x_token; {now expand and set |cur_cmd|, |cur_chr|, |cur_tok|}
 if cur_cmd=letter then goto main_loop_lookahead+1;
 if (cur_cmd>=kanji)and(cur_cmd<=hangul) then
@@ -858,15 +864,16 @@
 if cur_cmd=other_char then goto main_loop_lookahead+1;
 if cur_cmd=char_given then
   begin if check_echar_range(cur_chr) then goto main_loop_lookahead+1
-  else @<goto |main_lig_loop|@>;
+  else begin cur_cmd:=kcat_code(kcatcodekey(cur_chr)); @<goto |main_lig_loop|@>; end;
   end;
 if cur_cmd=char_num then
   begin scan_char_num; cur_chr:=cur_val;
   if check_echar_range(cur_chr) then goto main_loop_lookahead+1
-  else @<goto |main_lig_loop|@>;
+  else begin cur_cmd:=kcat_code(kcatcodekey(cur_chr)); @<goto |main_lig_loop|@>; end;
   end;
 if cur_cmd=kchar_num then
   begin scan_char_num; cur_chr:=cur_val;
+  cur_cmd:=kcat_code(kcatcodekey(cur_chr));
   @<goto |main_lig_loop|@>;
   end;
 @z
@@ -937,7 +944,7 @@
   if check_echar_range(cur_chr) then q:=new_character(f,cur_chr)
   else begin
     if direction=dir_tate then f:=cur_tfont else f:=cur_jfont;
-    KANJI(cx):=cur_chr
+    KANJI(cx):=cur_chr; cur_cmd:=kcat_code(kcatcodekey(cx));
     end
 else if cur_cmd=char_num then
   begin scan_char_num;
@@ -944,18 +951,18 @@
   if check_echar_range(cur_val) then q:=new_character(f,cur_val)
   else  begin
     if direction=dir_tate then f:=cur_tfont else f:=cur_jfont;
-    KANJI(cx):=cur_val
+    KANJI(cx):=cur_val; cur_cmd:=kcat_code(kcatcodekey(cx));
     end
   end
 else if cur_cmd=kchar_given then
   begin
     if direction=dir_tate then f:=cur_tfont else f:=cur_jfont;
-    KANJI(cx):=cur_chr
+    KANJI(cx):=cur_chr; cur_cmd:=kcat_code(kcatcodekey(cx));
   end
 else if cur_cmd=kchar_num then
   begin scan_char_num;
     if direction=dir_tate then f:=cur_tfont else f:=cur_jfont;
-    KANJI(cx):=cur_val
+    KANJI(cx):=cur_val; cur_cmd:=kcat_code(kcatcodekey(cx));
   end
 @z
 
@@ -1194,7 +1201,13 @@
 @x
     fast_get_avail(main_p); info(main_p):=KANJI(cur_chr);
 @y
-    fast_get_avail(main_p); info(main_p):=KANJI(cur_chr)+cur_cmd*max_cjk_val;
+    fast_get_avail(main_p);
+    if (cur_cmd>=kanji)and(cur_cmd<=hangul) then
+      info(main_p):=KANJI(cur_chr)+cur_cmd*max_cjk_val
+    else if cur_cmd=not_cjk then
+      info(main_p):=KANJI(cur_chr)+other_kchar*max_cjk_val
+    else { Does this case occur? }
+      info(main_p):=KANJI(cur_chr)+kcat_code(kcatcodekey(KANJI(cur_chr)))*max_cjk_val;
 @z
 
 @x
@@ -1230,6 +1243,7 @@
         begin ins_kp:=true; cur_l:=qi(0);
         end
       else cur_l:=qi(get_jfm_pos(KANJI(cur_chr),main_f));
+      cur_cmd:=kcat_code(kcatcodekey(cur_chr));
       end;
     char_num: begin scan_char_num; cur_chr:=cur_val;
       if check_echar_range(cur_chr) then
@@ -1236,12 +1250,15 @@
         begin ins_kp:=true; cur_l:=qi(0);
         end
       else cur_l:=qi(get_jfm_pos(KANJI(cur_chr),main_f));
+      cur_cmd:=kcat_code(kcatcodekey(cur_chr));
       end;
     kchar_given: begin
       cur_l:=qi(get_jfm_pos(KANJI(cur_chr),main_f));
+      cur_cmd:=kcat_code(kcatcodekey(cur_chr));
       end;
     kchar_num: begin scan_char_num; cur_chr:=cur_val;
       cur_l:=qi(get_jfm_pos(KANJI(cur_chr),main_f));
+      cur_cmd:=kcat_code(kcatcodekey(cur_chr));
       end;
 @z
 



More information about the tex-live-commits mailing list.