texlive[59787] Build/source/texk/web2c: e-pTeX 210701

commits+hironobu at tug.org commits+hironobu at tug.org
Thu Jul 1 11:30:47 CEST 2021


Revision: 59787
          http://tug.org/svn/texlive?view=revision&revision=59787
Author:   hironobu
Date:     2021-07-01 11:30:47 +0200 (Thu, 01 Jul 2021)
Log Message:
-----------
e-pTeX 210701 (\lastnodesubtype for math noads, \vadjust pre)

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/eptexdir/ChangeLog
    trunk/Build/source/texk/web2c/eptexdir/eptex.ech
    trunk/Build/source/texk/web2c/eptexdir/eptex_version.h
    trunk/Build/source/texk/web2c/eptexdir/pdfutils.ch
    trunk/Build/source/texk/web2c/ptexdir/ChangeLog
    trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch

Added Paths:
-----------
    trunk/Build/source/texk/web2c/eptexdir/tests/lastnodesubtype_math.tex

Modified: trunk/Build/source/texk/web2c/eptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/ChangeLog	2021-06-30 23:52:00 UTC (rev 59786)
+++ trunk/Build/source/texk/web2c/eptexdir/ChangeLog	2021-07-01 09:30:47 UTC (rev 59787)
@@ -1,3 +1,11 @@
+2021-07-01  Hironori Kitagawa  <h_kitagawa2001 at yahoo.co.jp>
+
+	* eptex.ech: Revise \lastnodesubtype to show math "noad" types,
+	  because \lastnodetype returns 15 for all math "noads".
+	* pdfutils.ch: Add \vadjust pre (by Hironobu Yamashita).
+	* eptex.ech, eptex_version.h: e-pTeX version 210701.
+	* tests/lastnodesubtype_math.tex: Added.
+
 2021-06-29  Hironori Kitagawa  <h_kitagawa2001 at yahoo.co.jp>
 
 	* eptex.defines: Add fromUCS().

Modified: trunk/Build/source/texk/web2c/eptexdir/eptex.ech
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/eptex.ech	2021-06-30 23:52:00 UTC (rev 59786)
+++ trunk/Build/source/texk/web2c/eptexdir/eptex.ech	2021-07-01 09:30:47 UTC (rev 59787)
@@ -3,9 +3,15 @@
 
 %% new primitives by e-pTeX
 %%
+%% \epTeXversion
+%% \epTeXinputencoding <euc|sjis|jis|utf8>
+%%
+%% \currentspacingmode: 1 iff auto_spacing
+%% \currentxspacingmode: 1 iff auto_xspacing
 %% \lastnodechar: the (internal) character code of the last node
 %%   -1: non-character or null
 %% \lastnodesubtype: the (internal) subtype of the last node
+%%   note: returns a value from the type if the node is s math noad.
 %%   -1: null
 %%   fallback to 0 if not explicitly set
 %% \readpapersizespecial
@@ -26,8 +32,8 @@
 @y
 @d eTeX_version_string=='-2.6' {current \eTeX\ version}
 @#
- at d epTeX_version_string=='-210629'
- at d epTeX_version_number==210629
+ at d epTeX_version_string=='-210701'
+ at d epTeX_version_number==210701
 @z
 
 @x e-pTeX: banner
@@ -239,7 +245,15 @@
         else if cur_val>disp_node then cur_val:=cur_val-1;
         end
       else cur_val:=unset_node; {\epTeX's |unset_node| is \eTeX's |unset_node+2|}
-    last_node_subtype_code: cur_val:=subtype(tx);
+    last_node_subtype_code: if type(tx)<=unset_node then cur_val:=subtype(tx)
+        { non-math nodes }
+      else begin
+        cur_val:=type(tx);
+	if cur_val<unset_node+4 then cur_val:=cur_val-unset_node-1
+	  { |style_noad|, |choice_noad|, |ord_noad| }
+        else if cur_val=unset_node+4 then cur_val:=cur_val-unset_node-1+subtype(tx)
+	else cur_val:=cur_val-unset_node+1;
+      end;
     last_node_char_code: ignore_font_kerning;
 @z
 

Modified: trunk/Build/source/texk/web2c/eptexdir/eptex_version.h
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/eptex_version.h	2021-06-30 23:52:00 UTC (rev 59786)
+++ trunk/Build/source/texk/web2c/eptexdir/eptex_version.h	2021-07-01 09:30:47 UTC (rev 59787)
@@ -1 +1 @@
-#define EPTEX_VERSION "210629"
+#define EPTEX_VERSION "210701"

Modified: trunk/Build/source/texk/web2c/eptexdir/pdfutils.ch
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/pdfutils.ch	2021-06-30 23:52:00 UTC (rev 59786)
+++ trunk/Build/source/texk/web2c/eptexdir/pdfutils.ch	2021-07-01 09:30:47 UTC (rev 59787)
@@ -29,6 +29,8 @@
 %% \ifincsname
 %%
 %% \Uchar, \Ucharcat
+%%
+%% \vadjust pre (2021-07-01)
 
 @x
 @* \[8] Packed data.
@@ -396,7 +398,33 @@
 @* \[8] Packed data.
 @z
 
+% [10] \vadjust pre
 @x
+ at d adjust_ptr(#)==mem[#+1].int
+  {vertical list to be moved out of horizontal list}
+ at y
+ at d adjust_pre == subtype  {<>0 => pre-adjustment}
+@#{|append_list| is used to append a list to |tail|}
+ at d append_list(#) == begin link(tail) := link(#); append_list_end
+ at d append_list_end(#) == tail := #; end
+
+ at d adjust_ptr(#)==mem[#+1].int
+  {vertical list to be moved out of horizontal list}
+ at z
+
+% [11] \vadjust pre
+ at x
+ at d hi_mem_stat_min==mem_top-13 {smallest statically allocated word in
+  the one-word |mem|}
+ at d hi_mem_stat_usage=14 {the number of one-word nodes always present}
+ at y
+ at d pre_adjust_head==mem_top-14  {head of pre-adjustment list returned by |hpack|}
+ at d hi_mem_stat_min==mem_top-14 {smallest statically allocated word in
+  the one-word |mem|}
+ at d hi_mem_stat_usage=15 {the number of one-word nodes always present}
+ at z
+
+ at x
 @* \[12] Displaying boxes.
 @y
 @<Declare procedures that need to be declared forward for \pdfTeX@>@;
@@ -404,6 +432,18 @@
 @* \[12] Displaying boxes.
 @z
 
+% [12] \vadjust pre
+ at x
+@ @<Display adjustment |p|@>=
+begin print_esc("vadjust"); node_list_display(adjust_ptr(p)); {recursive call}
+end
+ at y
+@ @<Display adjustment |p|@>=
+begin print_esc("vadjust"); if adjust_pre(p) <> 0 then print(" pre ");
+node_list_display(adjust_ptr(p)); {recursive call}
+end
+ at z
+
 @x \[if]pdfprimitive
 @d frozen_special=frozen_control_sequence+10
   {permanent `\.{\\special}'}
@@ -1191,6 +1231,190 @@
 @<Calculate DVI page dimensions and margins@>;
 @z
 
+% [33] \vadjust pre
+ at x
+if adjust_tail<>null then link(adjust_tail):=null;
+ at y
+if adjust_tail<>null then link(adjust_tail):=null;
+if pre_adjust_tail<>null then link(pre_adjust_tail):=null;
+ at z
+
+% [33] \vadjust pre
+ at x
+  ins_node,mark_node,adjust_node: if adjust_tail<>null then
+ at y
+  ins_node,mark_node,adjust_node: if (adjust_tail<>null) or (pre_adjust_tail<> null) then
+ at z
+
+% [33] \vadjust pre
+ at x
+to make a deletion.
+@^inner loop@>
+ at y
+to make a deletion.
+@^inner loop@>
+
+@<Glob...@>=
+@!pre_adjust_tail: pointer;
+
+@ @<Set init...@>=
+pre_adjust_tail := null;
+
+@ Materials in \.{\\vadjust} used with \.{pre} keyword will be appended to
+|pre_adjust_tail| instead of |adjust_tail|.
+
+ at d update_adjust_list(#) == begin
+    if # = null then
+        confusion("pre vadjust");
+    link(#) := adjust_ptr(p);
+    while link(#) <> null do
+        # := link(#);
+end
+ at z
+
+% [33] \vadjust pre
+ at x
+@<Transfer node |p| to the adjustment list@>=
+begin while link(q)<>p do q:=link(q);
+if type(p)=adjust_node then
+  begin link(adjust_tail):=adjust_ptr(p);
+  while link(adjust_tail)<>null do adjust_tail:=link(adjust_tail);
+  p:=link(p); free_node(link(q),small_node_size);
+  end
+else  begin link(adjust_tail):=p; adjust_tail:=p; p:=link(p);
+  end;
+link(q):=p; p:=q;
+ at y
+@<Transfer node |p| to the adjustment list@>=
+begin while link(q)<>p do q:=link(q);
+    if type(p) = adjust_node then begin
+        if adjust_pre(p) <> 0 then
+            update_adjust_list(pre_adjust_tail)
+        else
+            update_adjust_list(adjust_tail);
+        p := link(p); free_node(link(q), small_node_size);
+    end
+else  begin link(adjust_tail):=p; adjust_tail:=p; p:=link(p);
+  end;
+link(q):=p; p:=q;
+ at z
+
+% [37] \vadjust pre
+ at x
+ at d align_stack_node_size=5 {number of |mem| words to save alignment states}
+ at y
+ at d align_stack_node_size=6 {number of |mem| words to save alignment states}
+ at z
+
+% [37] \vadjust pre
+ at x
+@!cur_head,@!cur_tail:pointer; {adjustment list pointers}
+ at y
+@!cur_head,@!cur_tail:pointer; {adjustment list pointers}
+@!cur_pre_head,@!cur_pre_tail:pointer; {pre-adjustment list pointers}
+ at z
+
+% [37] \vadjust pre
+ at x
+cur_head:=null; cur_tail:=null;
+ at y
+cur_head:=null; cur_tail:=null;
+cur_pre_head:=null; cur_pre_tail:=null;
+ at z
+
+% [37] procedure |push_alignment|: \vadjust pre
+ at x
+info(p+4):=cur_head; link(p+4):=cur_tail;
+align_ptr:=p;
+cur_head:=get_avail;
+ at y
+info(p+4):=cur_head; link(p+4):=cur_tail;
+info(p+5):=cur_pre_head; link(p+5):=cur_pre_tail;
+align_ptr:=p;
+cur_head:=get_avail;
+cur_pre_head:=get_avail;
+ at z
+
+% [37] procedure |pop_alignment|: \vadjust pre
+ at x
+begin free_avail(cur_head);
+p:=align_ptr;
+cur_tail:=link(p+4); cur_head:=info(p+4);
+ at y
+begin free_avail(cur_head);
+free_avail(cur_pre_head);
+p:=align_ptr;
+cur_tail:=link(p+4); cur_head:=info(p+4);
+cur_pre_tail:=link(p+5); cur_pre_head:=info(p+5);
+ at z
+
+% [37] \vadjust pre
+ at x
+cur_align:=link(preamble); cur_tail:=cur_head; init_span(cur_align);
+ at y
+cur_align:=link(preamble); cur_tail:=cur_head; cur_pre_tail:=cur_pre_head;
+init_span(cur_align);
+ at z
+
+% [37] \vadjust pre + pTeX
+ at x
+  begin adjust_tail:=cur_tail; adjust_hlist(head,false);
+ at y
+  begin adjust_tail:=cur_tail; pre_adjust_tail:=cur_pre_tail;
+  adjust_hlist(head,false);
+ at z
+
+% [37] \vadjust pre
+ at x
+  cur_tail:=adjust_tail; adjust_tail:=null;
+ at y
+  cur_tail:=adjust_tail; adjust_tail:=null;
+  cur_pre_tail:=pre_adjust_tail; pre_adjust_tail:=null;
+ at z
+
+% [37] \vadjust pre
+ at x
+  pop_nest; append_to_vlist(p);
+  if cur_head<>cur_tail then
+    begin link(tail):=link(cur_head); tail:=cur_tail;
+    end;
+ at y
+  pop_nest;
+  if cur_pre_head <> cur_pre_tail then
+      append_list(cur_pre_head)(cur_pre_tail);
+  append_to_vlist(p);
+  if cur_head <> cur_tail then
+      append_list(cur_head)(cur_tail);
+ at z
+
+% [39] \vadjust pre
+ at x
+@ @<Append the new box to the current vertical list...@>=
+append_to_vlist(just_box);
+if adjust_head<>adjust_tail then
+  begin link(tail):=link(adjust_head); tail:=adjust_tail;
+   end;
+adjust_tail:=null
+ at y
+@ @<Append the new box to the current vertical list...@>=
+if pre_adjust_head <> pre_adjust_tail then
+    append_list(pre_adjust_head)(pre_adjust_tail);
+pre_adjust_tail := null;
+append_to_vlist(just_box);
+if adjust_head <> adjust_tail then
+    append_list(adjust_head)(adjust_tail);
+adjust_tail := null
+ at z
+
+% [39] \vadjust pre
+ at x
+adjust_tail:=adjust_head; just_box:=hpack(q,cur_width,exactly);
+ at y
+adjust_tail:=adjust_head;
+pre_adjust_tail := pre_adjust_head;
+just_box:=hpack(q,cur_width,exactly);
+ at z
+
 @x \[if]pdfprimitive: main_loop
 any_mode(ignore_spaces): begin @<Get the next non-blank non-call...@>;
   goto reswitch;
@@ -1220,6 +1444,109 @@
   end;
 @z
 
+% [47] \vadjust pre
+ at x
+  if abs(mode)=vmode then
+    begin append_to_vlist(cur_box);
+    if adjust_tail<>null then
+      begin if adjust_head<>adjust_tail then
+        begin link(tail):=link(adjust_head); tail:=adjust_tail;
+        end;
+      adjust_tail:=null;
+      end;
+    if mode>0 then build_page;
+    end
+ at y
+  if abs(mode)=vmode then
+    begin
+        if pre_adjust_tail <> null then begin
+            if pre_adjust_head <> pre_adjust_tail then
+                append_list(pre_adjust_head)(pre_adjust_tail);
+            pre_adjust_tail := null;
+        end;
+        append_to_vlist(cur_box);
+        if adjust_tail <> null then begin
+            if adjust_head <> adjust_tail then
+                append_list(adjust_head)(adjust_tail);
+            adjust_tail := null;
+        end;
+    if mode>0 then build_page;
+    end
+ at z
+
+% [47] \vadjust pre + pTeX
+ at x
+adjusted_hbox_group: begin adjust_hlist(head,false);
+  adjust_tail:=adjust_head; package(0);
+ at y
+adjusted_hbox_group: begin adjust_hlist(head,false);
+  adjust_tail:=adjust_head;
+  pre_adjust_tail:=pre_adjust_head; package(0);
+ at z
+
+% [47] \vadjust pre
+ at x
+saved(0):=cur_val; incr(save_ptr);
+ at y
+saved(0) := cur_val;
+if (cur_cmd = vadjust) and scan_keyword("pre") then
+    saved(1) := 1
+else
+    saved(1) := 0;
+save_ptr := save_ptr + 2;
+ at z
+
+% [47] \vadjust pre
+ at x
+  d:=split_max_depth; f:=floating_penalty; unsave; decr(save_ptr);
+ at y
+  d:=split_max_depth; f:=floating_penalty; unsave; save_ptr := save_ptr - 2;
+ at z
+
+% [47] \vadjust pre + pTeX
+ at x
+      r:=get_node(small_node_size); type(r):=adjust_node;@/
+      subtype(r):=0; {the |subtype| is not used}
+      adjust_ptr(r):=list_ptr(p); delete_glue_ref(q);
+ at y
+      r:=get_node(small_node_size); type(r):=adjust_node;@/
+      adjust_pre(r) := saved(1); {the |subtype| is used for |adjust_pre|}
+      adjust_ptr(r):=list_ptr(p); delete_glue_ref(q);
+ at z
+
+% [48] \vadjust pre
+ at x
+@!t:pointer; {tail of adjustment list}
+ at y
+@!t:pointer; {tail of adjustment list}
+@!pre_t:pointer; {tail of pre-adjustment list}
+ at z
+
+% [48] \vadjust pre
+ at x
+adjust_tail:=adjust_head; b:=hpack(p,natural); p:=list_ptr(b);
+t:=adjust_tail; adjust_tail:=null;@/
+ at y
+adjust_tail:=adjust_head; pre_adjust_tail:=pre_adjust_head;
+b:=hpack(p,natural); p:=list_ptr(b);
+t:=adjust_tail; adjust_tail:=null;@/
+pre_t:=pre_adjust_tail; pre_adjust_tail:=null;@/
+ at z
+
+% [48] \vadjust pre
+ at x
+if t<>adjust_head then {migrating material comes after equation number}
+  begin link(tail):=link(adjust_head); tail:=t;
+  end;
+ at y
+if t<>adjust_head then {migrating material comes after equation number}
+  begin link(tail):=link(adjust_head); tail:=t;
+  end;
+if pre_t<>pre_adjust_head then
+  begin link(tail):=link(pre_adjust_head); tail:=pre_t;
+  end;
+ at z
+
 @x \[if]pdfprimitive: dump prim table
 @<Dump the hash table@>=
 @y

Added: trunk/Build/source/texk/web2c/eptexdir/tests/lastnodesubtype_math.tex
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/tests/lastnodesubtype_math.tex	                        (rev 0)
+++ trunk/Build/source/texk/web2c/eptexdir/tests/lastnodesubtype_math.tex	2021-07-01 09:30:47 UTC (rev 59787)
@@ -0,0 +1,29 @@
+\def\typeout{\immediate\write17}
+\newcount\CNT\newcount\CNTs
+\def\TEST#1#2#3{\par$#1{xyz}#2\CNT=\lastnodetype\CNTs=\lastnodesubtype\typeout{\string #1: (\the\CNT,\the\CNTs)}#3$}
+
+\TEST\displaystyle\displaystyle{}
+\TEST\textstyle\textstyle{}
+\TEST\mathchoice{{a}{a}{a}}{}
+\TEST\mathord{}{}
+\TEST\mathop\displaylimits{}
+\TEST\mathop\limits{}
+\TEST\mathop\nolimits{}
+\TEST\mathbin{}{}
+\TEST\mathrel{}{}
+\TEST\mathopen{}{}
+\TEST\mathclose{}{}
+\TEST\mathpunct{}{}
+\TEST\mathinner{}{}
+\TEST\sqrt{}{}% radical
+\TEST\underline{}{}
+\TEST\overline{}{}
+\TEST\vcenter{}{}
+\TEST\dot{}{}% accent
+
+\TEST{left}{\left[}{\right]}
+\TEST{middle}{\left(\middle|}{\right)}
+\TEST{\left[\right]}{}{}
+% TODO: right, fraction
+
+\bye


Property changes on: trunk/Build/source/texk/web2c/eptexdir/tests/lastnodesubtype_math.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Build/source/texk/web2c/ptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ChangeLog	2021-06-30 23:52:00 UTC (rev 59786)
+++ trunk/Build/source/texk/web2c/ptexdir/ChangeLog	2021-07-01 09:30:47 UTC (rev 59787)
@@ -1,3 +1,7 @@
+2021-07-01  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
+
+	* ptex-base.ch: Set subtype=0 for adjust_node.
+
 2021-06-29  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-30 23:52:00 UTC (rev 59786)
+++ trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch	2021-07-01 09:30:47 UTC (rev 59787)
@@ -3501,8 +3501,8 @@
   hlist_node,vlist_node,dir_node,rule_node,unset_node:
     @<Incorporate box dimensions into the dimensions of
       the hbox that will contain~it@>;
-  ins_node,mark_node,adjust_node:
-    if adjust_tail<>null then @<Transfer node |p| to the adjustment list@>;
+  ins_node,mark_node,adjust_node: if adjust_tail<>null then
+    @<Transfer node |p| to the adjustment list@>;
   whatsit_node:@<Incorporate a whatsit node into an hbox@>;
   disp_node:disp:=disp_dimen(p);
 @z
@@ -5381,6 +5381,7 @@
       end
     else  begin
       r:=get_node(small_node_size); type(r):=adjust_node;@/
+      subtype(r):=0; {the |subtype| is not used}
       adjust_ptr(r):=list_ptr(p); delete_glue_ref(q);
       if not is_char_node(tail)and(type(tail)=disp_node) then
         prev_append(r)



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