summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/eptexdir
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2011-03-24 17:18:25 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2011-03-24 17:18:25 +0000
commit6fccde1aecdb4298832a925e87109c9f77205a19 (patch)
treef4251f80dfd29b98d23f625a3e46f534f46dafce /Build/source/texk/web2c/eptexdir
parent80341cec3f3bb955653de54ccb3e189bc6b6fa16 (diff)
e-TeX, pTeX: reformulate/simplify \lastbox, \unpenalty & Co
git-svn-id: svn://tug.org/texlive/trunk@21817 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/eptexdir')
-rw-r--r--Build/source/texk/web2c/eptexdir/ChangeLog.TL5
-rw-r--r--Build/source/texk/web2c/eptexdir/eptex.ech154
-rw-r--r--Build/source/texk/web2c/eptexdir/etex.ch068
-rw-r--r--Build/source/texk/web2c/eptexdir/etex.ch18
4 files changed, 214 insertions, 21 deletions
diff --git a/Build/source/texk/web2c/eptexdir/ChangeLog.TL b/Build/source/texk/web2c/eptexdir/ChangeLog.TL
index 89271a45d09..ccb7de206fb 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-24 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * eptex.ech, etex.ch0: Reformulate begin_box and delete_last to
+ reduce interferences between e-TeX and pTeX.
+
2011-03-22 Peter Breitenlohner <peb@mppmu.mpg.de>
* eptex.ech, etex.ch0: Reformulate @<Fetch an item in the
diff --git a/Build/source/texk/web2c/eptexdir/eptex.ech b/Build/source/texk/web2c/eptexdir/eptex.ech
index a1df317dbcf..1380574c7de 100644
--- a/Build/source/texk/web2c/eptexdir/eptex.ech
+++ b/Build/source/texk/web2c/eptexdir/eptex.ech
@@ -40,10 +40,10 @@
@z
@x [26.424] l.8510 - e-pTeX: last node
-@d set_effective_tail==set_effective_tail_pTeX
+@d find_effective_tail==find_effective_tail_pTeX
@y
-@d set_effective_tail_epTeX(#)== {Ignore final |disp_node| and\slash or \.{\\endM} node}
-set_effective_tail_pTeX(#);
+@d find_effective_tail_epTeX(#)== {Ignore final |disp_node| and\slash or \.{\\endM} node}
+find_effective_tail_pTeX(#);
if (type(tx)=math_node)and(subtype(tx)=end_M_code) then
begin r:=head;
repeat q:=r; r:=link(q); until link(r)=tx;
@@ -54,7 +54,7 @@ if (type(tx)=math_node)and(subtype(tx)=end_M_code) then
else tx:=r;
end
@#
-@d set_effective_tail==set_effective_tail_epTeX
+@d find_effective_tail==find_effective_tail_epTeX
@z
@x [26.424] l.8517 - e-pTeX: node types
@@ -94,6 +94,152 @@ if (type(tx)=math_node)and(subtype(tx)=end_M_code) then
@d set_box_lrstat_end(#) == (#)
@z
+@x [47.1079] l.20920
+@!r:pointer; {running behind |p|}
+@!a_dir:eight_bits; {adjust direction}
+@!disp,@!pdisp:scaled; {displacement}
+@!fd:boolean; {a final |disp_node| pair?}
+@!tx:pointer; {effective tail node}
+@!m:quarterword; {the length of a replacement list}
+@y
+@!a_dir:eight_bits; {adjust direction}
+@!d:pointer; {last |disp_node|}
+@!disp,@!pdisp:scaled; {displacement}
+@!pp,@!pnode:pointer;
+@!f:boolean; {will |d| free?}
+@!m:quarterword; {the length of a replacement list}
+@z
+
+@x [47.1080] l.20940
+@d fetch_effective_tail==fetch_effective_tail_pTeX
+@y
+@d fetch_effective_tail_epTeX(#)==
+@#
+@d fetch_effective_tail==fetch_effective_tail_epTeX
+@z
+
+@x [47.1080] l.20950
+else begin if not is_char_node(tail)and(head<>tail) then
+ begin find_effective_tail(goto done);
+ 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 f:=false;
+ if (not is_char_node(tail))and(type(tail)=disp_node) then
+ begin d:=tail; tail:=prev_node;
+ end
+ else d:=null;
+ if (not is_char_node(tail))and(head<>tail) then
+ if (type(tail)=hlist_node)or(type(tail)=vlist_node)
+ or(type(tail)=dir_node) then
+ @<Remove the last box, unless it's part of a discretionary@>;
+ if d<>null then
+ if (not is_char_node(tail))and(type(tail)=disp_node) then
+ begin prev_node:=pnode; prev_disp:=pdisp;
+ {|if prev_disp=disp_dimen(d) then free_node(tail,small_node_size)|}
+ if prev_disp<>disp_dimen(d) then disp_dimen(tail):=disp_dimen(d);
+ if f then free_node(d,small_node_size)
+ else begin prev_node:=tail; tail_append(d); end;
+ end
+ else tail_append(d);
+@z
+
+@x [47.1081] l.20957
+begin fetch_effective_tail(goto done);
+cur_box:=tx; shift_amount(cur_box):=0;
+if type(cur_box)=dir_node then
+ begin link(list_ptr(cur_box)):=cur_box;
+ cur_box:=list_ptr(cur_box);
+ list_ptr(link(cur_box)):=null;
+ end
+else
+ if box_dir(cur_box)=dir_default then set_box_dir(cur_box)(abs(direction));
+end
+@y
+begin q:=head; pp:=null; pnode:=null; disp:=0; pdisp:=0;
+repeat p:=q;
+if not is_char_node(q) then
+ if type(q)=disc_node then
+ begin for m:=1 to replace_count(q) do p:=link(p);
+ if p=tail then goto done;
+ end
+ else if type(q)=disp_node then
+ begin pnode:=pp; pdisp:=disp; disp:=disp_dimen(q);
+ end;
+pp:=q; q:=link(p);
+until q=tail;
+cur_box:=tail; shift_amount(cur_box):=0;
+tail:=p; link(p):=null;
+if type(cur_box)=dir_node then
+ begin link(list_ptr(cur_box)):=cur_box;
+ cur_box:=list_ptr(cur_box);
+ list_ptr(link(cur_box)):=null;
+ end
+else
+ if box_dir(cur_box)=dir_default then set_box_dir(cur_box)(abs(direction));
+done:end
+@z
+
+@x [47.1105] l.21246
+@!r:pointer; {running behind |p|}
+@!disp,@!pdisp:scaled; {displacement}
+@!fd:boolean; {a final |disp_node| pair?}
+@!tx:pointer; {effective tail node}
+@!m:quarterword; {the length of a replacement list}
+@y
+@!d:pointer; {last |disp_node|}
+@!disp,@!pdisp:scaled; {displacement}
+@!pp,@!pnode:pointer;
+@!f:integer;
+ {0: not append |d|, 1: append |d| (|tail| is removed)}
+ {2: |tail| is not removed }
+@!m:quarterword; {the length of a replacement list}
+@z
+
+@x [47.1105] l.21250
+else if not is_char_node(tail) then
+ begin find_effective_tail(return);
+ if type(tx)<>cur_chr then return;
+ fetch_effective_tail(return);
+ flush_node_list(tx);
+@y
+else begin
+ if (not is_char_node(tail))and(type(tail)=disp_node) then
+ begin f:=2; d:=tail; tail:=prev_node; link(tail):=null;
+ end
+ else d:=null;
+ if not is_char_node(tail) then if type(tail)=cur_chr then
+ begin q:=head; pp:=null; pnode:=null; disp:=0; pdisp:=0; f:=0;
+ repeat p:=q;
+ if not is_char_node(q) then
+ if type(q)=disc_node then
+ begin for m:=1 to replace_count(q) do p:=link(p);
+ if p=tail then
+ begin if d<>null then tail_append(d);
+ return;
+ end
+ else if link(p)=tail then f:=1;
+ end
+ else if type(q)=disp_node then
+ begin pnode:=pp; pdisp:=disp; disp:=disp_dimen(q);
+ end;
+ pp:=q; q:=link(p);
+ until q=tail;
+ link(p):=null; flush_node_list(tail); tail:=p;
+ end;
+ if d<>null then
+ if f<=1 then
+ begin prev_node:=pnode; prev_disp:=pdisp;
+ if (f=0)and(not is_char_node(tail))and(type(tail)=disp_node) then
+ begin disp_dimen(tail):=disp_dimen(d); free_node(d,small_node_size)
+ end
+ else begin prev_node:=tail; prev_disp:=disp; tail_append(d);
+ end;
+ end
+ else tail_append(d);
+@z
+
@x e-pTeX: font_char_{wd,ht,dp,ic}_code l.27306
begin i:=char_info(q)(qi(cur_val));
@y
diff --git a/Build/source/texk/web2c/eptexdir/etex.ch0 b/Build/source/texk/web2c/eptexdir/etex.ch0
index 124e04796f6..900b02c1715 100644
--- a/Build/source/texk/web2c/eptexdir/etex.ch0
+++ b/Build/source/texk/web2c/eptexdir/etex.ch0
@@ -33,13 +33,13 @@ if box(cur_val)=null then cur_val:=0 @+else cur_val:=mem[box(cur_val)+m].sc;
@z
@x [26.424]
-@d set_effective_tail==set_effective_tail_eTeX
+@d find_effective_tail==find_effective_tail_eTeX
@y
@z
@x [26.424]
- begin set_effective_tail(return);
+ begin find_effective_tail(return);
case cur_chr of
int_val: if type(tx)=penalty_node then cur_val:=penalty(tx);
dimen_val: if type(tx)=kern_node then cur_val:=width(tx);
@@ -116,15 +116,44 @@ if q=null then box(n):=null {the |eq_level| of the box stays the same}
else box(n):=vpack(q,natural);
@z
+@x [47.1079]
+@!r:pointer; {running behind |p|}
+@!fm:boolean; {a final \.{\\beginM} \.{\\endM} node pair?}
+@!tx:pointer; {effective tail node}
+@y
+@z
+
@x [47.1080]
- begin if (type(tail)=math_node)and(subtype(tail)=end_M_code) then
- remove_end_M;
+@d fetch_effective_tail==fetch_effective_tail_eTeX
+
@y
@z
@x [47.1080]
- if LR_temp<>null then insert_end_M;
- end;
+ begin find_effective_tail(goto done);
+ 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
+ if (type(tail)=hlist_node)or(type(tail)=vlist_node) then
+ @<Remove the last box, unless it's part of a discretionary@>;
+@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;
+if not is_char_node(q) then if type(q)=disc_node then
+ begin for m:=1 to replace_count(q) do p:=link(p);
+ if p=tail then goto done;
+ end;
+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]
@@ -134,17 +163,30 @@ else box(n):=vpack(q,natural);
@z
@x [47.1105]
-else begin if not is_char_node(tail) then
- begin if (type(tail)=math_node)and(subtype(tail)=end_M_code) then
- remove_end_M;
- if type(tail)=cur_chr then
+@!r:pointer; {running behind |p|}
+@!fm:boolean; {a final \.{\\beginM} \.{\\endM} node pair?}
+@!tx:pointer; {effective tail node}
@y
-else begin if not is_char_node(tail) then if type(tail)=cur_chr then
@z
+
@x [47.1105]
- if LR_temp<>null then insert_end_M;
- end;
+else if not is_char_node(tail) then
+ begin find_effective_tail(return);
+ if type(tx)<>cur_chr then return;
+ fetch_effective_tail(return);
+ flush_node_list(tx);
@y
+else begin if not is_char_node(tail) then if type(tail)=cur_chr then
+ begin q:=head;
+ repeat p:=q;
+ if not is_char_node(q) then if type(q)=disc_node then
+ begin for m:=1 to replace_count(q) do p:=link(p);
+ if p=tail then return;
+ end;
+ q:=link(p);
+ until q=tail;
+ link(p):=null; flush_node_list(tail); tail:=p;
+ end;
@z
@x [47.1110]
diff --git a/Build/source/texk/web2c/eptexdir/etex.ch1 b/Build/source/texk/web2c/eptexdir/etex.ch1
index 37c0c36c1d3..8596e15770d 100644
--- a/Build/source/texk/web2c/eptexdir/etex.ch1
+++ b/Build/source/texk/web2c/eptexdir/etex.ch1
@@ -154,11 +154,11 @@ change_box(q);
if type(tail)=cur_chr then
@z
@x [47.1105]
- begin prev_node:=tail; prev_disp:=disp; tail_append(d);
- end;
+ link(p):=null; flush_node_list(tail); tail:=p;
+ end;
@y
- begin prev_node:=tail; prev_disp:=disp; tail_append(d);
- end;
+ link(p):=null; flush_node_list(tail); tail:=p;
+ end;
if LR_temp<>null then insert_end_M;
end;
@z