texlive[45331] Build/source/texk/web2c/ptexdir: ptex-base.ch: frees

commits+hironobu at tug.org commits+hironobu at tug.org
Mon Sep 18 15:21:43 CEST 2017


Revision: 45331
          http://tug.org/svn/texlive?view=revision&revision=45331
Author:   hironobu
Date:     2017-09-18 15:21:43 +0200 (Mon, 18 Sep 2017)
Log Message:
-----------
ptex-base.ch: frees table entry, if the default value is assigned globally (H. Kitagawa)

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

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

Modified: trunk/Build/source/texk/web2c/ptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ChangeLog	2017-09-18 13:14:50 UTC (rev 45330)
+++ trunk/Build/source/texk/web2c/ptexdir/ChangeLog	2017-09-18 13:21:43 UTC (rev 45331)
@@ -1,3 +1,9 @@
+2017-09-11  Hironori Kitagawa  <h_kitagawa2001 at yahoo.co.jp>
+
+	* ptex-base.ch: Assigning the default value frees the KINSOKU table
+	and inhibit table, only if global or \currentgrouplevel=0.
+	* tests/kinsoku_table.tex: Added.
+
 2017-09-09  Hironori Kitagawa  <h_kitagawa2001 at yahoo.co.jp>
 
 	* ptex-base.ch: Remove JFM glue after kinsoku penalty at the top

Modified: trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch	2017-09-18 13:14:50 UTC (rev 45330)
+++ trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch	2017-09-18 13:21:43 UTC (rev 45331)
@@ -6292,11 +6292,13 @@
 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 then
+  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 }
+  else if j=no_entry then
     begin print_err("Inhibit table is full!!");
     help1("I'm skipping this control sequences.");@/
-    error; return;
-  end;
+    error; return; end;
   define(inhibit_xsp_code_base+j,cur_val,n);
   end
 else
@@ -6366,17 +6368,20 @@
 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 then
-    begin print_err("KINSOKU table is full!!");
-    help1("I'm skipping this control sequences.");@/
-    error; return;
-    end;
-  if (p=pre_break_penalty_code)or(p=post_break_penalty_code) then
-    begin define(kinsoku_base+j,p,tokanji(n));
-    word_define(kinsoku_penalty_base+j,cur_val);
+  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 }
+  else begin
+    if j=no_entry then begin
+      print_err("KINSOKU table is full!!");
+      help1("I'm skipping this control sequences.");@/
+      error; return; end;
+    if (p=pre_break_penalty_code)or(p=post_break_penalty_code) then
+      begin define(kinsoku_base+j,p,tokanji(n));
+      word_define(kinsoku_penalty_base+j,cur_val);
+      end
+    else confusion("kinsoku");
+@:this can't happen kinsoku}{\quad kinsoku@>
     end
-  else confusion("kinsoku");
-@:this can't happen kinsoku}{\quad kinsoku@>
   end
 else
   begin print_err("Invalid KANJI code for ");
@@ -6725,7 +6730,7 @@
 
 @ @<Insert a space after the |last_char|@>=
 if type(last_char)=math_node then
-  begin ax:=qo("0"); 
+  begin ax:=qo("0");
   if auto_xsp_code(ax)>=2 then
     insert_skip:=after_schar else insert_skip:=no_skip;
   end

Added: trunk/Build/source/texk/web2c/ptexdir/tests/kinsoku_table.tex
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/tests/kinsoku_table.tex	                        (rev 0)
+++ trunk/Build/source/texk/web2c/ptexdir/tests/kinsoku_table.tex	2017-09-18 13:21:43 UTC (rev 45331)
@@ -0,0 +1,46 @@
+%#!uptex
+\newcount\fuga\newcount\dflt
+\iffalse
+  \global\let\prebreakpenalty=\inhibitxspcode
+  \fuga="30D3 \dflt=3
+\else
+  \fuga="3090 \dflt=0
+\fi
+
+\scrollmode
+\newcount\hoge\hoge="3000
+\loop\ifnum\hoge<\fuga
+  \message{\the\hoge}\prebreakpenalty\hoge=2
+  \advance\hoge 1\relax \repeat
+
+\message{<\the\prebreakpenalty"3001, \the\prebreakpenalty"4000>}% 2, D
+{
+  \prebreakpenalty"3001=\dflt\relax
+  \global\prebreakpenalty"4000=1\relax% error
+\message{<\the\prebreakpenalty"3001, \the\prebreakpenalty"4000>}% D, D
+}
+
+\message{<\the\prebreakpenalty"3001, \the\prebreakpenalty"4000>}% 2, D
+
+{
+  \global\prebreakpenalty"3001=\dflt\relax
+  \prebreakpenalty"4000=1\relax% no error
+\message{<\the\prebreakpenalty"3001, \the\prebreakpenalty"4000>}% D, 1
+}
+\message{<\the\prebreakpenalty"3001, \the\prebreakpenalty"4000>}% D, D
+
+\prebreakpenalty"4000=1\relax% no error
+
+\message{<\the\prebreakpenalty"3001, \the\prebreakpenalty"4000,
+  \the\prebreakpenalty"3549>}% D, 1, D
+
+\prebreakpenalty"4000=\dflt\relax
+
+\prebreakpenalty"3549=1\relax% no error
+
+\message{<\the\prebreakpenalty"3001, \the\prebreakpenalty"4000,
+  \the\prebreakpenalty"3549>}% D, D, 1
+
+
+\end
+


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


More information about the tex-live-commits mailing list