summaryrefslogtreecommitdiff
path: root/Build/source/texk
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2011-03-30 16:16:28 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2011-03-30 16:16:28 +0000
commitb2025034e6288855de53c9fe2aecbd555ba065f6 (patch)
tree9c78f2eb5d3567220d2ddfd3a2bb2dd17a804449 /Build/source/texk
parente21b96f32d8c9ed4ca242796e353cfb6ff5fe43c (diff)
e-TeX, pTeX, e-pTeX: Handle disp_node from discretionary
git-svn-id: svn://tug.org/texlive/trunk@21892 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk')
-rw-r--r--Build/source/texk/web2c/eptexdir/ChangeLog.TL5
-rw-r--r--Build/source/texk/web2c/eptexdir/eptex.ech41
-rw-r--r--Build/source/texk/web2c/eptexdir/etex.ch018
-rw-r--r--Build/source/texk/web2c/etexdir/ChangeLog4
-rw-r--r--Build/source/texk/web2c/etexdir/etex.ch24
-rw-r--r--Build/source/texk/web2c/ptexdir/ChangeLog4
-rw-r--r--Build/source/texk/web2c/ptexdir/ptex-base.ch47
7 files changed, 118 insertions, 25 deletions
diff --git a/Build/source/texk/web2c/eptexdir/ChangeLog.TL b/Build/source/texk/web2c/eptexdir/ChangeLog.TL
index 0ac11892964..eaeeac7b523 100644
--- a/Build/source/texk/web2c/eptexdir/ChangeLog.TL
+++ b/Build/source/texk/web2c/eptexdir/ChangeLog.TL
@@ -1,6 +1,11 @@
ChangeLog.TL: TeX Live (TL) changes for e-pTeX
==============================================
+2011-03-30 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * eptex.ech, etex.ch0: Handle disp_node from discretionary.
+ Set correct last_node_type from main vertical list.
+
2011-03-29 Peter Breitenlohner <peb@mppmu.mpg.de>
* eptex.ech, etex.ch0: Redefine box_dir and box_lr to also work
diff --git a/Build/source/texk/web2c/eptexdir/eptex.ech b/Build/source/texk/web2c/eptexdir/eptex.ech
index 3e381fae846..53738c2e0a5 100644
--- a/Build/source/texk/web2c/eptexdir/eptex.ech
+++ b/Build/source/texk/web2c/eptexdir/eptex.ech
@@ -59,23 +59,31 @@ begin scan_eight_bit_int; q:=box(cur_val);
begin scan_register_num; fetch_box(q);
@z
+@x [26.424] l.8508 - e-pTeX: TeXXeT and disp_node
+node of the current list.
+@y
+node of the current list.
+The macro |find_effective_tail_epTeX| sets |tx| to the last non-\.{\\endM}
+non-|disp_node| of the current list.
+@z
+
@x [26.424] l.8510 - e-pTeX: last node
@d find_effective_tail==find_effective_tail_pTeX
@y
-@d find_effective_tail_epTeX== {sets |tx| to last non-\.{\\endM} non-|disp_node|}
+@d find_effective_tail_epTeX==
tx:=tail;
+if not is_char_node(tx) then if type(tx)=disp_node then tx:=prev_node;
if not is_char_node(tx) then
- begin if type(tx)=disp_node then tx:=prev_node;
- if not is_char_node(tx) then
- if (type(tx)=math_node)and(subtype(tx)=end_M_code) then
- begin r:=head;
- repeat q:=r; r:=link(q);
- until r=tx;
- tx:=q;
+ if (type(tx)=disp_node)or
+ ((type(tx)=math_node)and(subtype(tx)=end_M_code)) then
+ begin tx:=head; q:=link(head);
+ while q<>prev_node do
+ begin if is_char_node(q) then tx:=q
+ else if (type(q)<>disp_node)and
+ ((type(tx)<>math_node)or(subtype(tx)<>end_M_code)) then tx:=q;
end;
- if not is_char_node(tx) then
- if type(tx)=disp_node then tx:=prev_node;
- end
+ q:=link(q);
+ end
@#
@d find_effective_tail==find_effective_tail_epTeX
@z
@@ -102,15 +110,20 @@ if not is_char_node(tx) then
@x
@d box_lr(#) == (qo(subtype(#))) {direction mode of a box}
@d set_box_lr(#) == subtype(#):=set_box_lr_end
+@d set_box_lr_end(#) == qi(#)
@y
@d box_lr(#) == ((qo(subtype(#)))div 8) {direction mode of a box}
-@d set_box_lr(#) == subtype(#):=box_dir(#)+8*set_box_lr_end
+@d set_box_lr(#) == subtype(#):=box_dir(#)+set_box_lr_end
+@d set_box_lr_end(#) == qi(8*(#))
@z
@x [45.996] l.19420
last_node_type:=type(p)+1;
@y
-last_node_type:=type(p)+1;
+if type(p)<dir_node then last_node_type:=type(p)+1
+else if type(p)=dir_node then last_node_type:=type(list_ptr(p))+1
+else if type(p)<disp_node then last_node_type:=type(p)
+else last_node_type:=type(p)-1; {no |disp_node| in a vertical list}
@z
@x [47.1079] l.20920
@@ -124,6 +137,7 @@ last_node_type:=type(p)+1;
@z
@x [47.1080] l.20940
+@d check_effective_tail==check_effective_tail_pTeX
@d fetch_effective_tail==fetch_effective_tail_pTeX
@y
@d fetch_effective_tail_epTeX(#)== {extract |tx|,
@@ -200,6 +214,7 @@ if fm>0 then {drop \.{\\beginM} \.{\\endM} pair}
flush_node_list(t);
end
@#
+@d check_effective_tail(#)==find_effective_tail_epTeX
@d fetch_effective_tail==fetch_effective_tail_epTeX
@z
diff --git a/Build/source/texk/web2c/eptexdir/etex.ch0 b/Build/source/texk/web2c/eptexdir/etex.ch0
index 1fb7c8c68ee..154391e42c6 100644
--- a/Build/source/texk/web2c/eptexdir/etex.ch0
+++ b/Build/source/texk/web2c/eptexdir/etex.ch0
@@ -42,6 +42,13 @@ if box(cur_val)=null then cur_val:=0 @+else cur_val:=mem[box(cur_val)+m].sc;
@z
@x [26.424]
+legal in similar contexts.
+
+@y
+legal in similar contexts.
+@z
+
+@x [26.424]
@d find_effective_tail==find_effective_tail_eTeX
@y
@@ -136,22 +143,28 @@ else box(n):=vpack(q,natural);
@z
@x [47.1080]
+@d check_effective_tail(#)==find_effective_tail_eTeX
@d fetch_effective_tail==fetch_effective_tail_eTeX
@y
@z
@x [47.1080]
-else begin find_effective_tail;
+else begin check_effective_tail(goto done);
if not is_char_node(tx) then
if (type(tx)=hlist_node)or(type(tx)=vlist_node) then
+ @<Remove the last box, unless it's part of a discretionary@>;
+ done:end;
@y
else begin if not is_char_node(tail) then
if (type(tail)=hlist_node)or(type(tail)=vlist_node) then
+ @<Remove the last box, unless it's part of a discretionary@>;
+ end;
@z
@x [47.1081]
begin fetch_effective_tail(goto done);
cur_box:=tx; shift_amount(cur_box):=0;
+end
@y
begin q:=head;
repeat p:=q;
@@ -163,6 +176,7 @@ q:=link(p);
until q=tail;
cur_box:=tail; shift_amount(cur_box):=0;
tail:=p; link(p):=null;
+done:end
@z
@x [47.1096]
@@ -179,7 +193,7 @@ tail:=p; link(p):=null;
@z
@x [47.1105]
-else begin find_effective_tail;
+else begin check_effective_tail(return);
if not is_char_node(tx) then if type(tx)=cur_chr then
begin fetch_effective_tail(return);
flush_node_list(tx);
diff --git a/Build/source/texk/web2c/etexdir/ChangeLog b/Build/source/texk/web2c/etexdir/ChangeLog
index f23aded3498..9409a15c204 100644
--- a/Build/source/texk/web2c/etexdir/ChangeLog
+++ b/Build/source/texk/web2c/etexdir/ChangeLog
@@ -1,3 +1,7 @@
+2011-03-30 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * etex.ch: Further reduce e-pTeX interferences.
+
2011-03-29 Peter Breitenlohner <peb@mppmu.mpg.de>
* etex.ch: Rename box_lrstat into box_lr and define to also work
diff --git a/Build/source/texk/web2c/etexdir/etex.ch b/Build/source/texk/web2c/etexdir/etex.ch
index 6cb158f5031..a20e0306a8b 100644
--- a/Build/source/texk/web2c/etexdir/etex.ch
+++ b/Build/source/texk/web2c/etexdir/etex.ch
@@ -1186,10 +1186,19 @@ else if par_shape_ptr=null then cur_val:=0
\.{\\lastnodetype} are
@z
%---------------------------------------
+@x [26] m.424 l.8508 - e-TeX TeXXeT
+legal in similar contexts.
+@y
+legal in similar contexts.
+
+The macro |find_effective_tail_eTeX| sets |tx| to the last non-\.{\\endM}
+node of the current list.
+@z
+%---------------------------------------
@x [26] m.424 l.8510 - e-TeX TeXXeT
@<Fetch an item in the current node...@>=
@y
-@d find_effective_tail_eTeX== {sets |tx| to last non-\.{\\endM} node}
+@d find_effective_tail_eTeX==
tx:=tail;
if not is_char_node(tx) then
if (type(tx)=math_node)and(subtype(tx)=end_M_code) then
@@ -1528,7 +1537,7 @@ changes; the subtype of an an |hlist_node| inside R-text is changed to
@d dlist=2 {subtype for an |hlist_node| from display math mode}
@d box_lr(#) == (qo(subtype(#))) {direction mode of a box}
@d set_box_lr(#) == subtype(#):=set_box_lr_end
-@d set_box_lr_end(#) == (qi(#))
+@d set_box_lr_end(#) == qi(#)
@#
@d left_to_right=0
@d right_to_left=1
@@ -2352,6 +2361,7 @@ if q=null then if fm then confusion("tail1")
else if fm then {|r|$\to$|p=begin_M|$\to$|q=end_M|}
begin tail:=r; link(r):=null; flush_node_list(p);@+end
@#
+@d check_effective_tail(#)==find_effective_tail_eTeX
@d fetch_effective_tail==fetch_effective_tail_eTeX
@<If the current list ends with a box node, delete it...@>=
@@ -2360,10 +2370,14 @@ else if fm then {|r|$\to$|p=begin_M|$\to$|q=end_M|}
@x [47] m.1080 l.20950 - e-TeX TeXXeT
else begin if not is_char_node(tail) then
if (type(tail)=hlist_node)or(type(tail)=vlist_node) then
+ @<Remove the last box, unless it's part of a discretionary@>;
+ end;
@y
-else begin find_effective_tail;
+else begin check_effective_tail(goto done);
if not is_char_node(tx) then
if (type(tx)=hlist_node)or(type(tx)=vlist_node) then
+ @<Remove the last box, unless it's part of a discretionary@>;
+ done:end;
@z
%---------------------------------------
@x [47] m.1081 l.20957 - e-TeX TeXXeT
@@ -2377,9 +2391,11 @@ q:=link(p);
until q=tail;
cur_box:=tail; shift_amount(cur_box):=0;
tail:=p; link(p):=null;
+done:end
@y
begin fetch_effective_tail(goto done);
cur_box:=tx; shift_amount(cur_box):=0;
+end
@z
%---------------------------------------
@x [47] m.1082 l.20972 - e-TeX sparse arrays
@@ -2429,7 +2445,7 @@ else begin if not is_char_node(tail) then if type(tail)=cur_chr then
until q=tail;
link(p):=null; flush_node_list(tail); tail:=p;
@y
-else begin find_effective_tail;
+else begin check_effective_tail(return);
if not is_char_node(tx) then if type(tx)=cur_chr then
begin fetch_effective_tail(return);
flush_node_list(tx);
diff --git a/Build/source/texk/web2c/ptexdir/ChangeLog b/Build/source/texk/web2c/ptexdir/ChangeLog
index 96138338c46..117b026eb5a 100644
--- a/Build/source/texk/web2c/ptexdir/ChangeLog
+++ b/Build/source/texk/web2c/ptexdir/ChangeLog
@@ -1,3 +1,7 @@
+2011-03-30 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * ptex-base.ch: Handle disp_node from discretionary.
+
2011-03-29 Peter Breitenlohner <peb@mppmu.mpg.de>
* ptex-base.ch: Redefine box_dir to also work for
diff --git a/Build/source/texk/web2c/ptexdir/ptex-base.ch b/Build/source/texk/web2c/ptexdir/ptex-base.ch
index 3ce08faa52f..8e1a633185d 100644
--- a/Build/source/texk/web2c/ptexdir/ptex-base.ch
+++ b/Build/source/texk/web2c/ptexdir/ptex-base.ch
@@ -346,7 +346,7 @@ In p\TeX\ the |subtype| field records the box direction |box_dir|.
@#
@d box_dir(#) == (qo(subtype(#))) {direction of a box}
@d set_box_dir(#) == subtype(#):=set_box_dir_end
-@d set_box_dir_end(#) == (qi(#))
+@d set_box_dir_end(#) == qi(#)
@#
@d dir_default = 0 {direction of the box, default Left to Right}
@d dir_dtou = 1 {direction of the box, Bottom to Top}
@@ -1985,12 +1985,33 @@ else begin qx:=q;
end;
@z
+@x [26.424] l.8508 - pTeX: disp_node
+legal in similar contexts.
+@y
+legal in similar contexts.
+
+The macro |find_effective_tail_pTeX| sets |tx| to the last non-|disp_node|
+of the current list.
+@z
+
@x [26.424] l.8510 - pTeX: disp_node
@<Fetch an item in the current node...@>=
@y
-@d find_effective_tail_pTeX== {sets |tx| to last non-|disp_node|}
+@d find_effective_tail_pTeX==
tx:=tail;
-if not is_char_node(tx) then if type(tx)=disp_node then tx:=prev_node
+if not is_char_node(tx) then
+ if type(tx)=disp_node then
+ begin tx:=prev_node;
+ if not is_char_node(tx) then
+ if type(tx)=disp_node then {|disp_node| from a discretionary}
+ begin tx:=head; q:=link(head);
+ while q<>prev_node do
+ begin if is_char_node(q) then tx:=q
+ else if type(q)<>disp_node then tx:=q;
+ end;
+ q:=link(q);
+ end;
+ end
@#
@d find_effective_tail==find_effective_tail_pTeX
@@ -4662,6 +4683,15 @@ since |head| is a one-word node.
@x [47.1080] l.20940 - pTeX: disp_node
@<If the current list ends with a box node, delete it...@>=
@y
+@d check_effective_tail_pTeX(#)==
+tx:=tail;
+if not is_char_node(tx) then
+ if type(tx)=disp_node then
+ begin tx:=prev_node;
+ if not is_char_node(tx) then
+ if type(tx)=disp_node then #; {|disp_node| from a discretionary}
+ end
+@#
@d fetch_effective_tail_pTeX(#)== {extract |tx|, merge |disp_node| pair}
q:=head; p:=null; disp:=0; pdisp:=0;
repeat r:=p; p:=q; fd:=false;
@@ -4682,6 +4712,7 @@ else if fd then {|r|$\to$|p=disp_node|$\to$|q=disp_node|}
end
else prev_node:=p
@#
+@d check_effective_tail==check_effective_tail_pTeX
@d fetch_effective_tail==fetch_effective_tail_pTeX
@<If the current list ends with a box node, delete it...@>=
@@ -4690,11 +4721,15 @@ else prev_node:=p
@x [47.1080] l.20950 - pTeX: disp_node, check head=tail
else begin if not is_char_node(tail) then
if (type(tail)=hlist_node)or(type(tail)=vlist_node) then
+ @<Remove the last box, unless it's part of a discretionary@>;
+ end;
@y
-else begin find_effective_tail;
+else begin check_effective_tail(goto done);
if not is_char_node(tx)and(head<>tx) then
if (type(tx)=hlist_node)or(type(tx)=vlist_node)
or(type(tx)=dir_node) then
+ @<Remove the last box, unless it's part of a discretionary@>;
+ done:end;
@z
@x [47.1081] l.20957 - pTeX: disp_node
@@ -4719,7 +4754,7 @@ if type(cur_box)=dir_node then
end
else
if box_dir(cur_box)=dir_default then set_box_dir(cur_box)(abs(direction));
-done:end
+end
@z
@x [47.1083] l.20989 - pTeX: adjust_dir
@@ -4933,7 +4968,7 @@ else begin if not is_char_node(tail) then if type(tail)=cur_chr then
until q=tail;
link(p):=null; flush_node_list(tail); tail:=p;
@y
-else begin find_effective_tail;
+else begin check_effective_tail(return);
if not is_char_node(tx) then if type(tx)=cur_chr then
begin fetch_effective_tail(return);
flush_node_list(tx);