texlive[47477] Build/source/texk/web2c/ptexdir: ptexdir: fix a

commits+hironobu at tug.org commits+hironobu at tug.org
Sun Apr 29 01:58:23 CEST 2018


Revision: 47477
          http://tug.org/svn/texlive?view=revision&revision=47477
Author:   hironobu
Date:     2018-04-29 01:58:22 +0200 (Sun, 29 Apr 2018)
Log Message:
-----------
ptexdir: fix a regression for discontinuous kinsoku table introduced on 2017-09-11

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/ptexdir/ChangeLog
    trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch
    trunk/Build/source/texk/web2c/ptexdir/ptex_version.h

Added Paths:
-----------
    trunk/Build/source/texk/web2c/ptexdir/tests/free_ixsp.tex
    trunk/Build/source/texk/web2c/ptexdir/tests/free_pena.tex

Modified: trunk/Build/source/texk/web2c/ptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ChangeLog	2018-04-28 23:56:18 UTC (rev 47476)
+++ trunk/Build/source/texk/web2c/ptexdir/ChangeLog	2018-04-28 23:58:22 UTC (rev 47477)
@@ -1,3 +1,12 @@
+2018-04-14  Hironori Kitagawa  <h_kitagawa2001 at yahoo.co.jp>
+
+	* ptex-base.ch: Fix issue GitHub:texjporg/tex-jp-build#57
+	  that discontinuous KINSOKU/INHIBIT table cannot be
+	  searched properly.
+	  (regression caused by a commmit of 2017-09-11)
+	* tests/free_pena.tex, tests/free_ixsp.tex: Added.
+	* ptex_version.h: pTeX version p3.8.1.
+
 2018-02-05  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
 
 	* ptex-base.ch: Set subtype for JFM glue in math list.

Modified: trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch	2018-04-28 23:56:18 UTC (rev 47476)
+++ trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch	2018-04-28 23:58:22 UTC (rev 47477)
@@ -58,6 +58,7 @@
 %                  pTeX p3.7.1.
 % (2017-09-07) HK  pTeX p3.7.2 More restrictions on direction change commands.
 % (2018-01-21) HK  Added \ptexversion primitive and co. pTeX p3.8.
+% (2018-04-14) HK  pTeX p3.8.1 Bug fix for discontinuous KINSOKU table.
 %
 
 @x
@@ -73,8 +74,8 @@
 @y
 @d pTeX_version=3
 @d pTeX_minor_version=8
- at d pTeX_revision==".0"
- at d pTeX_version_string=='-p3.8.0' {current \pTeX\ version}
+ at d pTeX_revision==".1"
+ at d pTeX_version_string=='-p3.8.1' {current \pTeX\ version}
 @#
 @d pTeX_banner=='This is pTeX, Version 3.14159265',pTeX_version_string
 @d pTeX_banner_k==pTeX_banner
@@ -6397,6 +6398,8 @@
 @d inhibit_both=0     {disable to insert space before 2byte-char and after it}
 @d inhibit_previous=1 {disable to insert space before 2byte-char}
 @d inhibit_after=2    {disable to insert space after 2byte-char}
+ at d inhibit_none=3     {enable to insert space before/after 2byte-char}
+ at d inhibit_unused=4   {unused entry}
 @d no_entry=1000
 @d new_pos=0
 @d cur_pos=1
@@ -6427,14 +6430,15 @@
 begin s:=calc_pos(c); p:=s;
 if n=new_pos then
   begin repeat
-  if (inhibit_xsp_code(p)=0)or(inhibit_xsp_code(p)=c) then goto done;
+  if (inhibit_xsp_type(p)=inhibit_unused)or(inhibit_xsp_code(p)=0)
+    or(inhibit_xsp_code(p)=c) then goto done;
   incr(p); if p>255 then p:=0;
   until s=p; p:=no_entry;
   end
 else
   begin repeat
-  if inhibit_xsp_code(p)=0 then goto done1;
-  if inhibit_xsp_code(p)=c then goto done;
+  if inhibit_xsp_code(p)=0 then goto done1
+  else if (inhibit_xsp_type(p)<>inhibit_unused)and(inhibit_xsp_code(p)=c) then goto done;
   incr(p); if p>255 then p:=0;
   until s=p;
 done1: p:=no_entry;
@@ -6447,9 +6451,10 @@
 begin p:=cur_chr; scan_int; n:=cur_val; scan_optional_equals; scan_int;
 if is_char_kanji(n) then
   begin j:=get_inhibit_pos(tokanji(n),new_pos);
-  if (j<>no_entry)and(cur_val>inhibit_after)and(global or cur_level=level_one) then
-    begin n:=0; cur_val:=0 end
-    { remove the entry from inhibit table }
+  if (j<>no_entry)and(cur_val>inhibit_after) then
+    begin if global or(cur_level=level_one) then cur_val:=inhibit_unused
+      { remove the entry from inhibit table }
+	else cur_val:=inhibit_none; end
   else if j=no_entry then
     begin print_err("Inhibit table is full!!");
     help1("I'm skipping this control sequences.");@/
@@ -6466,7 +6471,7 @@
 
 @ @<Fetch inhibit type from some table@>=
 begin scan_int; q:=get_inhibit_pos(tokanji(cur_val),cur_pos);
-cur_val_level:=int_val; cur_val:=3;
+cur_val_level:=int_val; cur_val:=inhibit_none;
 if q<>no_entry then cur_val:=inhibit_xsp_type(q);
 end
 
@@ -6476,6 +6481,7 @@
 
 @d pre_break_penalty_code=1
 @d post_break_penalty_code=2
+ at d kinsoku_unused_code=3
 
 @<Put each...@>=
 primitive("prebreakpenalty",assign_kinsoku,pre_break_penalty_code);
@@ -6502,7 +6508,8 @@
 gubed
 if n=new_pos then
   begin repeat
-  if (kinsoku_type(p)=0)or(kinsoku_code(p)=c) then goto done;
+  if (kinsoku_type(p)=0)or(kinsoku_type(p)=kinsoku_unused_code)
+    or(kinsoku_code(p)=c) then goto done;
   incr(p); if p>255 then p:=0;
   until s=p;
   p:=no_entry;
@@ -6509,8 +6516,8 @@
   end
 else
   begin repeat
-  if kinsoku_type(p)=0 then goto done1;
-  if kinsoku_code(p)=c then goto done;
+  if kinsoku_type(p)=0 then goto done1
+  else if (kinsoku_type(p)<>kinsoku_unused_code)and(kinsoku_code(p)=c) then goto done;
   incr(p); if p>255 then p:=0;
   until s=p;
 done1: p:=no_entry;
@@ -6523,8 +6530,8 @@
 begin p:=cur_chr; scan_int; n:=cur_val; scan_optional_equals; scan_int;
 if is_char_ascii(n) or is_char_kanji(n) then
   begin j:=get_kinsoku_pos(tokanji(n),new_pos);
-  if (j<>no_entry)and(cur_val=0)and(global or cur_level=level_one) then
-    define(kinsoku_base+j,0,0) { remove the entry from KINSOKU table }
+  if (j<>no_entry)and(cur_val=0)and(global or(cur_level=level_one)) then
+    define(kinsoku_base+j,kinsoku_unused_code,0) { remove the entry from KINSOKU table }
   else begin
     if j=no_entry then begin
       print_err("KINSOKU table is full!!");

Modified: trunk/Build/source/texk/web2c/ptexdir/ptex_version.h
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ptex_version.h	2018-04-28 23:56:18 UTC (rev 47476)
+++ trunk/Build/source/texk/web2c/ptexdir/ptex_version.h	2018-04-28 23:58:22 UTC (rev 47477)
@@ -1 +1 @@
-#define PTEX_VERSION "p3.8.0"
+#define PTEX_VERSION "p3.8.1"

Added: trunk/Build/source/texk/web2c/ptexdir/tests/free_ixsp.tex
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/tests/free_ixsp.tex	                        (rev 0)
+++ trunk/Build/source/texk/web2c/ptexdir/tests/free_ixsp.tex	2018-04-28 23:58:22 UTC (rev 47477)
@@ -0,0 +1,53 @@
+%#!eptex -ini -etex
+\let\dump\relax
+\batchmode
+\input plain
+
+\errorstopmode
+\catcode`@=11
+\newcount\@tempcnta
+\newcount\@tempcntb
+\newcount\@tempcntc
+\mathchardef\LIM=256
+
+\def\MYCHAR#1{%
+  \@tempcntc=\numexpr7*#1+"101\relax
+  \@tempcnta=\@tempcntc\divide\@tempcnta 94
+  \@tempcntb=\numexpr\@tempcntc-94*\@tempcnta+1\relax
+  \ifnum\@tempcntb<0\advance\@tempcntb94 \advance\@tempcnta-1\fi
+  \advance\@tempcnta18 % 18区以降
+  \CNTA=\kuten\numexpr"100*\@tempcnta+\@tempcntb\relax
+}
+
+\newcount\CNT\newcount\CNTA
+\CNT=0
+\loop
+  \MYCHAR\CNT
+  \message{\the\CNT.}
+  \inhibitxspcode\CNTA=1\relax
+  \advance\CNT1\relax
+  \ifnum\CNT<\LIM
+\repeat
+
+\newcount\CNTB
+
+\loop
+  \MYCHAR\CNTB
+  \global\inhibitxspcode\CNTA=3
+{%
+\CNT=0
+\loop
+  \MYCHAR\CNT
+  \count@=\numexpr 1-\inhibitxspcode\CNTA\relax
+  \ifnum\count@=0\else\ifnum\CNTB=\CNT\else
+    \errmessage{<\the\CNTB, \the\CNT, \the\inhibitxspcode\CNTA>}\fi\fi
+  \advance\CNT1\relax
+  \ifnum\CNT<\LIM
+\repeat
+}
+  \MYCHAR\CNTB
+  \global\inhibitxspcode\CNTA=1\relax
+  \advance\CNTB1\relax
+  \ifnum\CNTB<\LIM
+\repeat
+\bye


Property changes on: trunk/Build/source/texk/web2c/ptexdir/tests/free_ixsp.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Build/source/texk/web2c/ptexdir/tests/free_pena.tex
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/tests/free_pena.tex	                        (rev 0)
+++ trunk/Build/source/texk/web2c/ptexdir/tests/free_pena.tex	2018-04-28 23:58:22 UTC (rev 47477)
@@ -0,0 +1,52 @@
+%#!eptex -ini -etex
+\let\dump\relax
+\batchmode
+\input plain
+
+\errorstopmode
+\catcode`@=11
+\newcount\@tempcnta
+\newcount\@tempcntb
+\newcount\@tempcntc
+\mathchardef\LIM=256
+
+\def\MYCHAR#1{%
+  \@tempcntc=\numexpr7*#1+"101\relax
+  \@tempcnta=\@tempcntc\divide\@tempcnta 94
+  \@tempcntb=\numexpr\@tempcntc-94*\@tempcnta+1\relax
+  \ifnum\@tempcntb<0\advance\@tempcntb94 \advance\@tempcnta-1\fi
+  \advance\@tempcnta18 % 18区以降
+  \CNTA=\kuten\numexpr"100*\@tempcnta+\@tempcntb\relax
+}
+
+\newcount\CNT\newcount\CNTA
+\CNT=0
+\loop
+  \MYCHAR\CNT
+  \message{\the\CNT.}
+  \prebreakpenalty\CNTA=\numexpr\CNT+1\relax
+  \advance\CNT1\relax
+  \ifnum\CNT<\LIM
+\repeat
+
+\newcount\CNTB
+
+\loop
+  \MYCHAR\CNTB
+  \global\prebreakpenalty\CNTA=0
+{%
+\CNT=0
+\loop
+  \MYCHAR\CNT
+  \count@=\numexpr -\CNT-1+\prebreakpenalty\CNTA\relax
+  \ifnum\count@=0\else\ifnum\CNTB=\CNT\else\errmessage{<\the\CNTB, \the\CNT>}\fi\fi
+  \advance\CNT1\relax
+  \ifnum\CNT<\LIM
+\repeat
+}
+  \MYCHAR\CNTB
+  \global\prebreakpenalty\CNTA=\numexpr\CNTB+1\relax
+  \advance\CNTB1\relax
+  \ifnum\CNTB<\LIM
+\repeat
+\bye


Property changes on: trunk/Build/source/texk/web2c/ptexdir/tests/free_pena.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property


More information about the tex-live-commits mailing list