texlive[59750] Build/source/texk/web2c: [e][u]ptex: add \ucs and
commits+hironobu at tug.org
commits+hironobu at tug.org
Tue Jun 29 14:09:25 CEST 2021
Revision: 59750
http://tug.org/svn/texlive?view=revision&revision=59750
Author: hironobu
Date: 2021-06-29 14:09:25 +0200 (Tue, 29 Jun 2021)
Log Message:
-----------
[e][u]ptex: add \ucs and \toucs, invalid code -> -1
Modified Paths:
--------------
trunk/Build/source/texk/web2c/eptexdir/ChangeLog
trunk/Build/source/texk/web2c/eptexdir/eptex.defines
trunk/Build/source/texk/web2c/eptexdir/eptex.ech
trunk/Build/source/texk/web2c/eptexdir/eptex_version.h
trunk/Build/source/texk/web2c/ptexdir/ChangeLog
trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch
trunk/Build/source/texk/web2c/ptexdir/ptex.defines
trunk/Build/source/texk/web2c/ptexdir/ptex_version.h
trunk/Build/source/texk/web2c/uptexdir/ChangeLog
trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch
trunk/Build/source/texk/web2c/uptexdir/uptex.defines
Modified: trunk/Build/source/texk/web2c/eptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/ChangeLog 2021-06-29 12:08:43 UTC (rev 59749)
+++ trunk/Build/source/texk/web2c/eptexdir/ChangeLog 2021-06-29 12:09:25 UTC (rev 59750)
@@ -1,3 +1,9 @@
+2021-06-29 Hironori Kitagawa <h_kitagawa2001 at yahoo.co.jp>
+
+ * eptex.defines: Add fromUCS().
+ * eptex.ech, eptex_version.h: e-pTeX version 210629
+ (adapted to pTeX p3.10.0).
+
2021-06-25 Hironori Kitagawa <h_kitagawa2001 at yahoo.co.jp>
* etex.ch1: Adapt to ptex-base.ch for fix of
Modified: trunk/Build/source/texk/web2c/eptexdir/eptex.defines
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/eptex.defines 2021-06-29 12:08:43 UTC (rev 59749)
+++ trunk/Build/source/texk/web2c/eptexdir/eptex.defines 2021-06-29 12:09:25 UTC (rev 59750)
@@ -28,6 +28,7 @@
@define function fromSJIS ();
@define function fromKUTEN ();
@define function UCStoUTF8 ();
+ at define function fromUCS ();
@define function toUCS ();
@define function notkanjicharseq ();
Modified: trunk/Build/source/texk/web2c/eptexdir/eptex.ech
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/eptex.ech 2021-06-29 12:08:43 UTC (rev 59749)
+++ trunk/Build/source/texk/web2c/eptexdir/eptex.ech 2021-06-29 12:09:25 UTC (rev 59750)
@@ -26,8 +26,8 @@
@y
@d eTeX_version_string=='-2.6' {current \eTeX\ version}
@#
- at d epTeX_version_string=='-210218'
- at d epTeX_version_number==210218
+ at d epTeX_version_string=='-210629'
+ at d epTeX_version_number==210629
@z
@x e-pTeX: banner
Modified: trunk/Build/source/texk/web2c/eptexdir/eptex_version.h
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/eptex_version.h 2021-06-29 12:08:43 UTC (rev 59749)
+++ trunk/Build/source/texk/web2c/eptexdir/eptex_version.h 2021-06-29 12:09:25 UTC (rev 59750)
@@ -1 +1 @@
-#define EPTEX_VERSION "210218"
+#define EPTEX_VERSION "210629"
Modified: trunk/Build/source/texk/web2c/ptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ChangeLog 2021-06-29 12:08:43 UTC (rev 59749)
+++ trunk/Build/source/texk/web2c/ptexdir/ChangeLog 2021-06-29 12:09:25 UTC (rev 59750)
@@ -1,3 +1,14 @@
+2021-06-29 Hironori Kitagawa <h_kitagawa2001 at yahoo.co.jp>
+ and Hironobu Yamashita <h.y.acetaminophen at gmail.com>
+
+ * ptex-base.ch:
+ - Bug fix: Wrap print_hex for negative value.
+ - Change: Code conversion primitives return -1 for invalid.
+ - Added: New primitives \ucs (from upTeX) and \toucs.
+ * ptex.defines: Add fromUCS() and toUCS().
+ * ptex_version.h: pTeX version p3.10.0.
+ https://github.com/texjporg/tex-jp-build/pull/121
+
2021-06-25 Hironori Kitagawa <h_kitagawa2001 at yahoo.co.jp>
and Hironobu Yamashita <h.y.acetaminophen at gmail.com>
Modified: trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch 2021-06-29 12:08:43 UTC (rev 59749)
+++ trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch 2021-06-29 12:09:25 UTC (rev 59750)
@@ -64,7 +64,8 @@
% (2021-02-18) HK pTeX p3.9.0 Add \ifjfont and \iftfont (in 2020-02-06, by HY),
% Bug fix for getting \kansujichar (in 2020-02-09 = TL20),
% based on TeX 3.141592653 (for TL21).
-% (2021-06-25) HY pTeX p3.9.1 Various fixes
+% (2021-06-25) HY pTeX p3.9.1 Various fixes.
+% (2021-06-20) HK pTeX p3.10.0 Add \ucs and \toucs.
@x
% Here is TeX material that gets inserted after \input webmac
@@ -78,9 +79,9 @@
@d banner_k==TeX_banner_k
@y
@d pTeX_version=3
- at d pTeX_minor_version=9
- at d pTeX_revision==".1"
- at d pTeX_version_string=='-p3.9.1' {current \pTeX\ version}
+ at d pTeX_minor_version=10
+ at d pTeX_revision==".0"
+ at d pTeX_version_string=='-p3.10.0' {current \pTeX\ version}
@#
@d pTeX_banner=='This is pTeX, Version 3.141592653',pTeX_version_string
@d pTeX_banner_k==pTeX_banner
@@ -329,6 +330,16 @@
wterm(')');
@z
+ at x pTeX: print_hex for "Invalid KANJI code" or "Invalid KANSUJI char" errors
+@ Old versions of \TeX\ needed a procedure called |print_ASCII| whose function
+ at y
+@ Hexadecimal printing.
+
+ at d print_hex_safe(#)==if #<0 then print_int(#) else print_hex(#)
+
+@ Old versions of \TeX\ needed a procedure called |print_ASCII| whose function
+ at z
+
@x
@d max_halfword==@"FFFFFFF {largest allowable value in a |halfword|}
@y
@@ -2375,8 +2386,10 @@
@d sjis_code=7 {command code for \.{\\sjis}}
@d jis_code=8 {command code for \.{\\jis}}
@d kuten_code=9 {command code for \.{\\kuten}}
- at d ptex_revision_code=10 {command code for \.{\\ptexrevision}}
- at d ptex_convert_codes=11 {end of \pTeX's command codes}
+ at d ucs_code=10 {command code for \.{\\ucs}}
+ at d toucs_code=11 {command code for \.{\\toucs}}
+ at d ptex_revision_code=12 {command code for \.{\\ptexrevision}}
+ at d ptex_convert_codes=13 {end of \pTeX's command codes}
@d job_name_code=ptex_convert_codes {command code for \.{\\jobname}}
@z
@@ -2396,6 +2409,10 @@
@!@:jis_}{\.{\\jis} primitive@>
primitive("kuten",convert,kuten_code);
@!@:kuten_}{\.{\\kuten} primitive@>
+primitive("ucs",convert,ucs_code);
+@!@:ucs_}{\.{\\ucs} primitive@>
+primitive("toucs",convert,toucs_code);
+@!@:toucs_}{\.{\\toucs} primitive@>
primitive("ptexrevision",convert,ptex_revision_code);
@!@:ptexrevision_}{\.{\\ptexrevision} primitive@>
@z
@@ -2409,6 +2426,8 @@
sjis_code:print_esc("sjis");
jis_code:print_esc("jis");
kuten_code:print_esc("kuten");
+ ucs_code:print_esc("ucs");
+ toucs_code:print_esc("toucs");
ptex_revision_code:print_esc("ptexrevision");
@z
@@ -2433,7 +2452,7 @@
KANJI(cx):=0;
case c of
number_code,roman_numeral_code,
-kansuji_code,euc_code,sjis_code,jis_code,kuten_code: scan_int;
+kansuji_code,euc_code,sjis_code,jis_code,kuten_code,ucs_code,toucs_code: scan_int;
ptex_revision_code: do_nothing;
string_code, meaning_code: begin save_scanner_status:=scanner_status;
scanner_status:=normal; get_token;
@@ -2455,10 +2474,18 @@
case c of
number_code: print_int(cur_val);
roman_numeral_code: print_roman_int(cur_val);
-jis_code: print_int(fromJIS(cur_val));
-euc_code: print_int(fromEUC(cur_val));
-sjis_code: print_int(fromSJIS(cur_val));
-kuten_code: print_int(fromKUTEN(cur_val));
+jis_code: begin cur_val:=fromJIS(cur_val);
+ if cur_val=0 then print_int(-1) else print_int(cur_val); end;
+euc_code: begin cur_val:=fromEUC(cur_val);
+ if cur_val=0 then print_int(-1) else print_int(cur_val); end;
+sjis_code: begin cur_val:=fromSJIS(cur_val);
+ if cur_val=0 then print_int(-1) else print_int(cur_val); end;
+kuten_code: begin cur_val:=fromKUTEN(cur_val);
+ if cur_val=0 then print_int(-1) else print_int(cur_val); end;
+ucs_code: begin cur_val:=fromUCS(cur_val);
+ if cur_val=0 then print_int(-1) else print_int(cur_val); end;
+toucs_code: begin cur_val:=toUCS(cur_val);
+ if cur_val=0 then print_int(-1) else print_int(cur_val); end;
ptex_revision_code: print(pTeX_revision);
kansuji_code: print_kansuji(cur_val);
string_code:if cur_cs<>0 then sprint_cs(cur_cs)
@@ -6481,7 +6508,7 @@
begin p:=cur_chr; scan_int; n:=cur_val; scan_optional_equals; scan_int;
if not is_char_kanji(cur_val) then
begin print_err("Invalid KANSUJI char (");
- print_hex(cur_val); print_char(")");
+ print_hex_safe(cur_val); print_char(")");
@.Invalid KANSUJI char@>
help1("I'm skipping this control sequences.");@/
error; return;
@@ -6643,7 +6670,7 @@
define(inhibit_xsp_code_base+j,cur_val,n);
end
else
- begin print_err("Invalid KANJI code ("); print_hex(n); print_char(")");
+ begin print_err("Invalid KANJI code ("); print_hex_safe(n); print_char(")");
@.Invalid KANJI code@>
help1("I'm skipping this control sequences.");@/
error; return;
@@ -6735,7 +6762,7 @@
if p=pre_break_penalty_code then print("pre")
else if p=post_break_penalty_code then print("post")
else print_char("?");
- print("breakpenalty ("); print_hex(n); print_char(")");
+ print("breakpenalty ("); print_hex_safe(n); print_char(")");
@.Invalid KANJI code@>
help1("I'm skipping this control sequences.");@/
error; return;
@@ -7422,7 +7449,7 @@
@ @<Look ahead for glue or kerning@>=
cur_q:=tail;
if inhibit_glue_flag<>true then
- begin { print("IF");print_int(cur_l); }
+ begin
if cur_l<qi(0) then cur_l:=qi(0) else inhibit_glue_flag:=false;
if (tail=link(head))and(not is_char_node(tail))and(type(tail)=disp_node) then
goto skip_loop
@@ -7470,7 +7497,7 @@
end;
end
else
- begin { print("IT");print_int(cur_l); }
+ begin
if cur_l<qi(0) then cur_l:=qi(0) else inhibit_glue_flag:=false;
end;
skip_loop: do_nothing;
Modified: trunk/Build/source/texk/web2c/ptexdir/ptex.defines
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ptex.defines 2021-06-29 12:08:43 UTC (rev 59749)
+++ trunk/Build/source/texk/web2c/ptexdir/ptex.defines 2021-06-29 12:09:25 UTC (rev 59750)
@@ -20,6 +20,8 @@
@define function fromEUC ();
@define function fromSJIS ();
@define function fromKUTEN ();
+ at define function fromUCS ();
+ at define function toUCS ();
@define function notkanjicharseq ();
@define function checkkanji ();
Modified: trunk/Build/source/texk/web2c/ptexdir/ptex_version.h
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ptex_version.h 2021-06-29 12:08:43 UTC (rev 59749)
+++ trunk/Build/source/texk/web2c/ptexdir/ptex_version.h 2021-06-29 12:09:25 UTC (rev 59750)
@@ -1 +1 @@
-#define PTEX_VERSION "p3.9.1"
+#define PTEX_VERSION "p3.10.0"
Modified: trunk/Build/source/texk/web2c/uptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/ChangeLog 2021-06-29 12:08:43 UTC (rev 59749)
+++ trunk/Build/source/texk/web2c/uptexdir/ChangeLog 2021-06-29 12:09:25 UTC (rev 59750)
@@ -1,3 +1,8 @@
+2021-06-29 Hironori Kitagawa <h_kitagawa2001 at yahoo.co.jp>
+
+ * uptex-m.ch: Adapt to pTeX p3.10.0.
+ * uptex.defines: Add toUCS().
+
2021-06-25 Hironobu Yamashita <h.y.acetaminophen at gmail.com>
* uptex—m.ch: Adapt to ptex-base.ch for no re-eval.
Modified: trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch 2021-06-29 12:08:43 UTC (rev 59749)
+++ trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch 2021-06-29 12:09:25 UTC (rev 59750)
@@ -633,21 +633,12 @@
@x
- at d ptex_revision_code=10 {command code for \.{\\ptexrevision}}
- at d ptex_convert_codes=11 {end of \pTeX's command codes}
- at y
- at d ucs_code=10 {command code for \.{\\ucs}}
- at d ptex_revision_code=11 {command code for \.{\\ptexrevision}}
- at d uptex_revision_code=12 {command code for \.{\\uptexrevision}}
+ at d ptex_revision_code=12 {command code for \.{\\ptexrevision}}
@d ptex_convert_codes=13 {end of \pTeX's command codes}
- at z
-
- at x
-@!@:kuten_}{\.{\\kuten} primitive@>
@y
-@!@:kuten_}{\.{\\kuten} primitive@>
-primitive("ucs",convert,ucs_code);
-@!@:ucs_}{\.{\\ucs} primitive@>
+ at d ptex_revision_code=12 {command code for \.{\\ptexrevision}}
+ at d uptex_revision_code=13 {command code for \.{\\uptexrevision}}
+ at d ptex_convert_codes=14 {end of \pTeX's command codes}
@z
@x
@@ -661,13 +652,6 @@
@z
@x
- kuten_code:print_esc("kuten");
- at y
- kuten_code:print_esc("kuten");
- ucs_code:print_esc("ucs");
- at z
-
- at x
ptex_revision_code:print_esc("ptexrevision");
@y
ptex_revision_code:print_esc("ptexrevision");
@@ -675,13 +659,11 @@
@z
@x
-kansuji_code,euc_code,sjis_code,jis_code,kuten_code: scan_int;
ptex_revision_code: do_nothing;
string_code, meaning_code: begin save_scanner_status:=scanner_status;
scanner_status:=normal; get_token;
if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then {|wchar_token|}
@y
-kansuji_code,euc_code,sjis_code,jis_code,kuten_code,ucs_code: scan_int;
ptex_revision_code, uptex_revision_code: do_nothing;
string_code, meaning_code: begin save_scanner_status:=scanner_status;
scanner_status:=normal; get_token;
@@ -689,10 +671,17 @@
@z
@x
-kuten_code: print_int(fromKUTEN(cur_val));
+ucs_code: begin cur_val:=fromUCS(cur_val);
+ if cur_val=0 then print_int(-1) else print_int(cur_val); end;
+toucs_code: begin cur_val:=toUCS(cur_val);
+ if cur_val=0 then print_int(-1) else print_int(cur_val); end;
@y
-kuten_code: print_int(fromKUTEN(cur_val));
-ucs_code: print_int(fromUCS(cur_val));
+ucs_code: if (isinternalUPTEX) then print_int(fromUCS(cur_val))
+ else begin cur_val:=fromUCS(cur_val);
+ if cur_val=0 then print_int(-1) else print_int(cur_val); end;
+toucs_code: if (isinternalUPTEX) then print_int(toUCS(cur_val))
+ else begin cur_val:=toUCS(cur_val);
+ if cur_val=0 then print_int(-1) else print_int(cur_val); end;
@z
@x
Modified: trunk/Build/source/texk/web2c/uptexdir/uptex.defines
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/uptex.defines 2021-06-29 12:08:43 UTC (rev 59749)
+++ trunk/Build/source/texk/web2c/uptexdir/uptex.defines 2021-06-29 12:09:25 UTC (rev 59750)
@@ -32,6 +32,7 @@
@define function fromSJIS ();
@define function fromKUTEN ();
@define function fromUCS ();
+ at define function toUCS ();
@define function notkanjicharseq ();
@define function checkkanji ();
More information about the tex-live-commits
mailing list.