diff options
author | Hironobu Yamashita <h.y.acetaminophen@gmail.com> | 2021-06-29 12:09:25 +0000 |
---|---|---|
committer | Hironobu Yamashita <h.y.acetaminophen@gmail.com> | 2021-06-29 12:09:25 +0000 |
commit | 7bc30853dc6c5c55866c56236a9a5eb3c135e5f5 (patch) | |
tree | 88104e102571d5a6151eedf42cfefcea559c80e6 /Build/source/texk | |
parent | 6cee5b73a7fb36a8a1abcdbd0d1be611d2be35f2 (diff) |
[e][u]ptex: add \ucs and \toucs, invalid code -> -1
git-svn-id: svn://tug.org/texlive/trunk@59750 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk')
-rw-r--r-- | Build/source/texk/web2c/eptexdir/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/eptexdir/eptex.defines | 1 | ||||
-rw-r--r-- | Build/source/texk/web2c/eptexdir/eptex.ech | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/eptexdir/eptex_version.h | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/ptexdir/ChangeLog | 11 | ||||
-rw-r--r-- | Build/source/texk/web2c/ptexdir/ptex-base.ch | 59 | ||||
-rw-r--r-- | Build/source/texk/web2c/ptexdir/ptex.defines | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/ptexdir/ptex_version.h | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/uptexdir/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/uptexdir/uptex-m.ch | 39 | ||||
-rw-r--r-- | Build/source/texk/web2c/uptexdir/uptex.defines | 1 |
11 files changed, 87 insertions, 45 deletions
diff --git a/Build/source/texk/web2c/eptexdir/ChangeLog b/Build/source/texk/web2c/eptexdir/ChangeLog index 09ad2fa3f4b..7b6041c0e07 100644 --- a/Build/source/texk/web2c/eptexdir/ChangeLog +++ b/Build/source/texk/web2c/eptexdir/ChangeLog @@ -1,3 +1,9 @@ +2021-06-29 Hironori Kitagawa <h_kitagawa2001@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@yahoo.co.jp> * etex.ch1: Adapt to ptex-base.ch for fix of diff --git a/Build/source/texk/web2c/eptexdir/eptex.defines b/Build/source/texk/web2c/eptexdir/eptex.defines index 4ec82524536..d6f6c96131b 100644 --- a/Build/source/texk/web2c/eptexdir/eptex.defines +++ b/Build/source/texk/web2c/eptexdir/eptex.defines @@ -28,6 +28,7 @@ @define function fromSJIS (); @define function fromKUTEN (); @define function UCStoUTF8 (); +@define function fromUCS (); @define function toUCS (); @define function notkanjicharseq (); diff --git a/Build/source/texk/web2c/eptexdir/eptex.ech b/Build/source/texk/web2c/eptexdir/eptex.ech index 75d3b03355b..aed42a75c38 100644 --- a/Build/source/texk/web2c/eptexdir/eptex.ech +++ b/Build/source/texk/web2c/eptexdir/eptex.ech @@ -26,8 +26,8 @@ @y @d eTeX_version_string=='-2.6' {current \eTeX\ version} @# -@d epTeX_version_string=='-210218' -@d epTeX_version_number==210218 +@d epTeX_version_string=='-210629' +@d epTeX_version_number==210629 @z @x e-pTeX: banner diff --git a/Build/source/texk/web2c/eptexdir/eptex_version.h b/Build/source/texk/web2c/eptexdir/eptex_version.h index a79725d296b..51cc8d04803 100644 --- a/Build/source/texk/web2c/eptexdir/eptex_version.h +++ b/Build/source/texk/web2c/eptexdir/eptex_version.h @@ -1 +1 @@ -#define EPTEX_VERSION "210218" +#define EPTEX_VERSION "210629" diff --git a/Build/source/texk/web2c/ptexdir/ChangeLog b/Build/source/texk/web2c/ptexdir/ChangeLog index 540b9cf7337..54a43e3cabc 100644 --- a/Build/source/texk/web2c/ptexdir/ChangeLog +++ b/Build/source/texk/web2c/ptexdir/ChangeLog @@ -1,3 +1,14 @@ +2021-06-29 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp> + and Hironobu Yamashita <h.y.acetaminophen@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@yahoo.co.jp> and Hironobu Yamashita <h.y.acetaminophen@gmail.com> diff --git a/Build/source/texk/web2c/ptexdir/ptex-base.ch b/Build/source/texk/web2c/ptexdir/ptex-base.ch index 54bf299a670..be88cd51309 100644 --- a/Build/source/texk/web2c/ptexdir/ptex-base.ch +++ b/Build/source/texk/web2c/ptexdir/ptex-base.ch @@ -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 -@d pTeX_minor_version=9 -@d pTeX_revision==".1" -@d pTeX_version_string=='-p3.9.1' {current \pTeX\ version} +@d pTeX_minor_version=10 +@d pTeX_revision==".0" +@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 @@ else wterm(')'); @z +@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 +@y +@ Hexadecimal printing. + +@d print_hex_safe(#)==if #<0 then print_int(#) else print_hex(#) + +@ Old versions of \TeX\ needed a procedure called |print_ASCII| whose function +@z + @x @d max_halfword==@"FFFFFFF {largest allowable value in a |halfword|} @y @@ -2375,8 +2386,10 @@ help6("Dimensions can be in units of em, ex, zw, zh, in, pt, pc,")@/ @d sjis_code=7 {command code for \.{\\sjis}} @d jis_code=8 {command code for \.{\\jis}} @d kuten_code=9 {command code for \.{\\kuten}} -@d ptex_revision_code=10 {command code for \.{\\ptexrevision}} -@d ptex_convert_codes=11 {end of \pTeX's command codes} +@d ucs_code=10 {command code for \.{\\ucs}} +@d toucs_code=11 {command code for \.{\\toucs}} +@d ptex_revision_code=12 {command code for \.{\\ptexrevision}} +@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 @@ primitive("jis",convert,jis_code); @!@: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 @@ primitive("ptexrevision",convert,ptex_revision_code); 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 @@ string_code, meaning_code: begin save_scanner_status:=scanner_status; 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 @@ string_code:if cur_cs<>0 then sprint_cs(cur_cs) 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 @@ set_kansuji_char: 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 @@ if is_char_kanji(n) then 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 @@ else 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 @@ end; @ @<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 @@ if inhibit_glue_flag<>true then 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; diff --git a/Build/source/texk/web2c/ptexdir/ptex.defines b/Build/source/texk/web2c/ptexdir/ptex.defines index 8dd0d77429e..e087b545741 100644 --- a/Build/source/texk/web2c/ptexdir/ptex.defines +++ b/Build/source/texk/web2c/ptexdir/ptex.defines @@ -20,6 +20,8 @@ @define function fromEUC (); @define function fromSJIS (); @define function fromKUTEN (); +@define function fromUCS (); +@define function toUCS (); @define function notkanjicharseq (); @define function checkkanji (); diff --git a/Build/source/texk/web2c/ptexdir/ptex_version.h b/Build/source/texk/web2c/ptexdir/ptex_version.h index 22aed30e864..91d996f48a6 100644 --- a/Build/source/texk/web2c/ptexdir/ptex_version.h +++ b/Build/source/texk/web2c/ptexdir/ptex_version.h @@ -1 +1 @@ -#define PTEX_VERSION "p3.9.1" +#define PTEX_VERSION "p3.10.0" diff --git a/Build/source/texk/web2c/uptexdir/ChangeLog b/Build/source/texk/web2c/uptexdir/ChangeLog index 719bec88973..427056e0d20 100644 --- a/Build/source/texk/web2c/uptexdir/ChangeLog +++ b/Build/source/texk/web2c/uptexdir/ChangeLog @@ -1,3 +1,8 @@ +2021-06-29 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp> + + * uptex-m.ch: Adapt to pTeX p3.10.0. + * uptex.defines: Add toUCS(). + 2021-06-25 Hironobu Yamashita <h.y.acetaminophen@gmail.com> * uptex—m.ch: Adapt to ptex-base.ch for no re-eval. diff --git a/Build/source/texk/web2c/uptexdir/uptex-m.ch b/Build/source/texk/web2c/uptexdir/uptex-m.ch index 780f83a9e38..4e806e6d94b 100644 --- a/Build/source/texk/web2c/uptexdir/uptex-m.ch +++ b/Build/source/texk/web2c/uptexdir/uptex-m.ch @@ -633,21 +633,12 @@ while k<pool_ptr do @x -@d ptex_revision_code=10 {command code for \.{\\ptexrevision}} -@d ptex_convert_codes=11 {end of \pTeX's command codes} -@y -@d ucs_code=10 {command code for \.{\\ucs}} -@d ptex_revision_code=11 {command code for \.{\\ptexrevision}} -@d uptex_revision_code=12 {command code for \.{\\uptexrevision}} +@d ptex_revision_code=12 {command code for \.{\\ptexrevision}} @d ptex_convert_codes=13 {end of \pTeX's command codes} -@z - -@x -@!@:kuten_}{\.{\\kuten} primitive@> @y -@!@:kuten_}{\.{\\kuten} primitive@> -primitive("ucs",convert,ucs_code); -@!@:ucs_}{\.{\\ucs} primitive@> +@d ptex_revision_code=12 {command code for \.{\\ptexrevision}} +@d uptex_revision_code=13 {command code for \.{\\uptexrevision}} +@d ptex_convert_codes=14 {end of \pTeX's command codes} @z @x @@ -661,13 +652,6 @@ primitive("uptexrevision",convert,uptex_revision_code); @z @x - kuten_code:print_esc("kuten"); -@y - kuten_code:print_esc("kuten"); - ucs_code:print_esc("ucs"); -@z - -@x ptex_revision_code:print_esc("ptexrevision"); @y ptex_revision_code:print_esc("ptexrevision"); @@ -675,13 +659,11 @@ primitive("uptexrevision",convert,uptex_revision_code); @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 @@ string_code, meaning_code: begin save_scanner_status:=scanner_status; @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 diff --git a/Build/source/texk/web2c/uptexdir/uptex.defines b/Build/source/texk/web2c/uptexdir/uptex.defines index 52243e57185..9a59b7b0a1a 100644 --- a/Build/source/texk/web2c/uptexdir/uptex.defines +++ b/Build/source/texk/web2c/uptexdir/uptex.defines @@ -32,6 +32,7 @@ @define function fromSJIS (); @define function fromKUTEN (); @define function fromUCS (); +@define function toUCS (); @define function notkanjicharseq (); @define function checkkanji (); |