summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2011-03-26 15:29:43 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2011-03-26 15:29:43 +0000
commit83c77a6f9ab33bc5aab2fd8bda79e11524cca702 (patch)
treebde2639dcd021a947b9318eb0dfd7538a4bb0448
parent8bea2fb9f960bdb62f8be6bbb2c9b740b437702d (diff)
e-pTeX: reformulate/simplify \lastbox, \unpenalty & Co
git-svn-id: svn://tug.org/texlive/trunk@21837 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/tetex/updmap.pl2
-rw-r--r--Build/source/texk/web2c/eptexdir/ChangeLog.TL8
-rw-r--r--Build/source/texk/web2c/eptexdir/eptex.ech210
-rw-r--r--Build/source/texk/web2c/eptexdir/etex.ch132
-rw-r--r--Build/source/texk/web2c/eptexdir/pdfstrcmp.ch2
-rw-r--r--Build/source/texk/web2c/etexdir/etex.ch16
-rw-r--r--Build/source/texk/web2c/ptexdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/ptexdir/ptex-base.ch116
8 files changed, 162 insertions, 229 deletions
diff --git a/Build/source/texk/tetex/updmap.pl b/Build/source/texk/tetex/updmap.pl
index f75461ad543..3b8a8a9e7c9 100644
--- a/Build/source/texk/tetex/updmap.pl
+++ b/Build/source/texk/tetex/updmap.pl
@@ -733,7 +733,7 @@ sub showOptions {
if ($item eq "LW35") {
print "URWkb URW ADOBE ADOBEkb\n";
}
- elsif ($item =~ m/"(dvipsPreferOutline|pdftexDownloadBase14|dvipdfmDownloadBase14|dvipsDownloadBase35)"/) {
+ elsif ($item =~ m/(dvipsPreferOutline|pdftexDownloadBase14|dvipdfmDownloadBase14|dvipsDownloadBase35)/) {
print "true false\n";
}
else {
diff --git a/Build/source/texk/web2c/eptexdir/ChangeLog.TL b/Build/source/texk/web2c/eptexdir/ChangeLog.TL
index ccb7de206fb..2950cfccdae 100644
--- a/Build/source/texk/web2c/eptexdir/ChangeLog.TL
+++ b/Build/source/texk/web2c/eptexdir/ChangeLog.TL
@@ -1,10 +1,12 @@
ChangeLog.TL: TeX Live (TL) changes for e-pTeX
==============================================
-2011-03-24 Peter Breitenlohner <peb@mppmu.mpg.de>
+2011-03-25 Peter Breitenlohner <peb@mppmu.mpg.de>
- * eptex.ech, etex.ch0: Reformulate begin_box and delete_last to
- reduce interferences between e-TeX and pTeX.
+ * eptex.ech, etex.ch[01]: Reformulate begin_box and delete_last
+ to reduce interferences between e-TeX and pTeX.
+
+ * pdfstrcmp.ch (save_warning_index): Drop unused variable.
2011-03-22 Peter Breitenlohner <peb@mppmu.mpg.de>
diff --git a/Build/source/texk/web2c/eptexdir/eptex.ech b/Build/source/texk/web2c/eptexdir/eptex.ech
index 1380574c7de..8a102eb99e4 100644
--- a/Build/source/texk/web2c/eptexdir/eptex.ech
+++ b/Build/source/texk/web2c/eptexdir/eptex.ech
@@ -42,13 +42,13 @@
@x [26.424] l.8510 - e-pTeX: last node
@d find_effective_tail==find_effective_tail_pTeX
@y
-@d find_effective_tail_epTeX(#)== {Ignore final |disp_node| and\slash or \.{\\endM} node}
+@d find_effective_tail_epTeX(#)== {sets |tx| to last non-\.{\\endM} non-|disp_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;
if is_char_node(r) then #;
- if (type(r)=disp_node) then
+ if type(r)=disp_node then
if is_char_node(q)or(q=head) then #
else tx:=q
else tx:=r;
@@ -95,149 +95,103 @@ if (type(tx)=math_node)and(subtype(tx)=end_M_code) then
@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}
+@!s:pointer; {running behind |r|}
+@!t:pointer;
+@!fm:integer; {1: if |r|, 2: if |p| is a \.{\\beginM} node}
+@!gm:integer; {1: if |link(q)|, 2: if |q| is an \.{\\endM} node}
+@!fd,@!gd:integer; {same for |disp_node|}
@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
+@d fetch_effective_tail_epTeX(#)== {extract |tx|,
+ drop \.{\\beginM} \.{\\endM} pair and\slash or merge |disp_node| pair}
+q:=head; p:=null; r:=null; fm:=0; fd:=0; disp:=0; pdisp:=0;
+repeat s:=r; r:=p; p:=q; fm:=fm div 2; fd:=fd div 2;
+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;
+ if p=tx then #;
end
+ else if (type(q)=math_node)and(subtype(q)=begin_M_code) then fm:=2
else if type(q)=disp_node then
- begin pnode:=pp; pdisp:=disp; disp:=disp_dimen(q);
+ begin pdisp:=disp; disp:=disp_dimen(q); fd:=2;@+end;
+q:=link(p);
+until q=tx; {found |s|$\to$|r|$\to$|p|$\to$|q=tx|}
+q:=link(tx); link(p):=q; link(tx):=null;
+if q=null then begin tail:=p; gm:=0; gd:=0;@+end
+else begin if type(q)=math_node then
+ begin gm:=2;
+ if link(q)=null then gd:=0
+ else if type(link(q))=disp_node then gd:=1
+ else confusion("tail3");
+@:this can't happen tail3}{\quad tail3@>
+ end
+ else if type(q)=disp_node then
+ begin prev_node:=p; gd:=2;
+ if link(q)=null then gm:=0
+ else if type(link(q))=math_node then gm:=1
+ else confusion("tail4");
+@:this can't happen tail4}{\quad tail4@>
+ end
+ else confusion("tail5");
+@:this can't happen tail5}{\quad tail5@>
+ end;
+if gm=0 then if fm=2 then confusion("tail1")
+@:this can't happen tail1}{\quad tail1@>
+ else if fm=1 then confusion("tail2");
+@:this can't happen tail2}{\quad tail2@>
+if (fm+fd)=1 then begin fm:=0; fd:=0;@+end;
+if gm=0 then fm:=0;
+if gd=0 then fd:=0;
+@#
+if fd>0 then {merge a |disp_node| pair}
+ begin if gm=0 then {|p|$\to$|q=disp_node|$to$|null|}
+ begin t:=q; q:=null; link(p):=q; tail:=p;@+end
+ else if gm=1 then {|p|$\to$|q=disp_node|$to$|end_M|$to$|null|}
+ begin t:=q; q:=link(q); link(p):=q; gm:=2;@+end
+ else {|p|$\to$|q=end_M|$\to$|disp_node|$to$|null|}
+ begin t:=link(q); link(q):=null; tail:=q;@+end;
+@#
+ if fd=1 then {|s|$\to$|r=disp_node|}
+ begin prev_node:=s; disp_dimen(r):=disp_dimen(t);@+end
+ else {|r|$\to$|p=disp_node|}
+ begin prev_node:=r; disp_dimen(p):=disp_dimen(t);@+end;
+ prev_disp:=pdisp; free_node(t,small_node_size); gd:=0;
+ end;
+@#
+if fm>0 then {drop \.{\\beginM} \.{\\endM} pair}
+ begin if gd=0 then {|p|$\to$|q=end_M|$to$|null|}
+ begin t:=q; q:=null; link(p):=q; tail:=p;@+end
+ else if gd=1 then {|p|$\to$|q=end_M|$to$|disp_node|$to$|null|}
+ begin t:=q; q:=link(q); link(p):=q; prev_node:=p; link(t):=null
+ end
+ else {|p|$\to$|q=disp_node|$\to$|end_M|$to$|null|}
+ begin t:=link(q); link(q):=null; tail:=q;@+end;
+@#
+ if fm=1 then {|s|$\to$|r=begin_M|$\to$|p=disp_node|}
+ begin link(s):=p; link(r):=t; t:=r; prev_node:=s;@+end
+ else {|r|$\to$|p=begin_M|$\to$|q|}
+ begin link(r):=q; link(p):=t; t:=p;
+ if q=null then tail:=r@+else prev_node:=r;
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;
+ flush_node_list(t);
end
-else
- if box_dir(cur_box)=dir_default then set_box_dir(cur_box)(abs(direction));
-done:end
+@#
+@d fetch_effective_tail==fetch_effective_tail_epTeX
@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);
+@!s:pointer; {running behind |r|}
+@!t:pointer;
+@!fm:integer; {1: if |r|, 2: if |p| is a \.{\\beginM} node}
+@!gm:integer; {1: if |link(q)|, 2: if |q| is an \.{\\endM} node}
+@!fd,@!gd:integer; {same for |disp_node|}
@z
@x e-pTeX: font_char_{wd,ht,dp,ic}_code l.27306
diff --git a/Build/source/texk/web2c/eptexdir/etex.ch1 b/Build/source/texk/web2c/eptexdir/etex.ch1
index 8596e15770d..db1aa74ec32 100644
--- a/Build/source/texk/web2c/eptexdir/etex.ch1
+++ b/Build/source/texk/web2c/eptexdir/etex.ch1
@@ -125,44 +125,12 @@ if q<>null then begin
change_box(q);
@z
-@x [47.1080]
- 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@>;
-@y
- begin if (type(tail)=math_node)and(subtype(tail)=end_M_code) then
- remove_end_M;
- 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 LR_temp<>null then insert_end_M;
- end;
-@z
-
@x [47.1096]
else begin adjust_hlist(head,true); line_break(widow_penalty)
@y
else begin adjust_hlist(head,true); line_break(false)
@z
-@x [47.1105]
- if not is_char_node(tail) then if type(tail)=cur_chr then
-@y
- 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
-@z
-@x [47.1105]
- link(p):=null; flush_node_list(tail); tail:=p;
- end;
-@y
- link(p):=null; flush_node_list(tail); tail:=p;
- end;
- if LR_temp<>null then insert_end_M;
- end;
-@z
-
@x [47.1110]
begin if type(box(cur_val))=dir_node then
begin delete_glue_ref(space_ptr(box(cur_val)));
diff --git a/Build/source/texk/web2c/eptexdir/pdfstrcmp.ch b/Build/source/texk/web2c/eptexdir/pdfstrcmp.ch
index 870bfdfb332..6c37a4d0665 100644
--- a/Build/source/texk/web2c/eptexdir/pdfstrcmp.ch
+++ b/Build/source/texk/web2c/eptexdir/pdfstrcmp.ch
@@ -34,7 +34,9 @@ we have to create a temporary string that is destroyed immediately after.
@y
@!save_scanner_status:small_number; {|scanner_status| upon entry}
@!save_def_ref: pointer; {|def_ref| upon entry, important if inside `\.{\\message}'}
+@{
@!save_warning_index: pointer;
+@}
@!u: str_number; {saved current string string}
@z
diff --git a/Build/source/texk/web2c/etexdir/etex.ch b/Build/source/texk/web2c/etexdir/etex.ch
index f82dc094e35..a3d4ba5cbd1 100644
--- a/Build/source/texk/web2c/etexdir/etex.ch
+++ b/Build/source/texk/web2c/etexdir/etex.ch
@@ -1182,7 +1182,7 @@ else if par_shape_ptr=null then cur_val:=0
@x [26] m.424 l.8510 - e-TeX TeXXeT
@<Fetch an item in the current node...@>=
@y
-@d find_effective_tail_eTeX(#)== {Ignore final \.{\\endM} node}
+@d find_effective_tail_eTeX(#)== {sets |tx| to last non-\.{\\endM} node}
if (type(tail)=math_node)and(subtype(tail)=end_M_code) then
begin tx:=head;
while link(tx)<>tail do tx:=link(tx);
@@ -2325,7 +2325,8 @@ copy_code: begin scan_register_num; fetch_box(q); cur_box:=copy_node_list(q);
@x [47] m.1080 l.20940 - e-TeX TeXXeT
@<If the current list ends with a box node, delete it...@>=
@y
-@d fetch_effective_tail_eTeX(#)==
+@d fetch_effective_tail_eTeX(#)== {extract |tx|,
+ drop \.{\\beginM} \.{\\endM} pair}
q:=head; p:=null;
repeat r:=p; p:=q; fm:=false;
if not is_char_node(q) then
@@ -2335,12 +2336,13 @@ if not is_char_node(q) then
end
else if (type(q)=math_node)and(subtype(q)=begin_M_code) then fm:=true;
q:=link(p);
-until q=tx;
+until q=tx; {found |r|$\to$|p|$\to$|q=tx|}
q:=link(tx); link(p):=q; link(tx):=null;
-if q=null then tail:=p
-else if fm then
- begin tail:=r; link(r):=null; flush_node_list(p);
- end
+if q=null then if fm then confusion("tail1")
+@:this can't happen tail1}{\quad tail1@>
+ else tail:=p
+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 fetch_effective_tail==fetch_effective_tail_eTeX
diff --git a/Build/source/texk/web2c/ptexdir/ChangeLog b/Build/source/texk/web2c/ptexdir/ChangeLog
index cf7fd229c3e..cb39bd82cd5 100644
--- a/Build/source/texk/web2c/ptexdir/ChangeLog
+++ b/Build/source/texk/web2c/ptexdir/ChangeLog
@@ -1,3 +1,8 @@
+2011-03-26 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * ptex-base.ch: Fix a bug in begin_box introduced on 2011-03-24,
+ mail from Hironori Kitagawa, Sat, 26 Mar 2011 21:42:49.
+
2011-03-24 Peter Breitenlohner <peb@mppmu.mpg.de>
* ptex-base.ch: Reformulate begin_box and delete_last to reduce
diff --git a/Build/source/texk/web2c/ptexdir/ptex-base.ch b/Build/source/texk/web2c/ptexdir/ptex-base.ch
index c1eb61779e0..69303bfbf7c 100644
--- a/Build/source/texk/web2c/ptexdir/ptex-base.ch
+++ b/Build/source/texk/web2c/ptexdir/ptex-base.ch
@@ -1538,7 +1538,7 @@ begin switch: if loc<=limit then {current line not yet finished}
@^inner loop@>
begin switch: if loc<=limit then {current line not yet finished}
begin cur_chr:=buffer[loc]; incr(loc);
- if (multistrlen(buffer, limit+1, loc-1)=2) then
+ if multistrlen(buffer, limit+1, loc-1)=2 then
begin cur_chr:=fromBUFF(buffer, limit+1, loc-1);
cur_cmd:=kcat_code(kcatcodekey(cur_chr));
incr(loc);
@@ -1628,7 +1628,7 @@ end
@<Scan a control...@>=
begin if loc>limit then cur_cs:=null_cs {|state| is irrelevant in this case}
else begin k:=loc; cur_chr:=buffer[k]; incr(k);
- if (multistrlen(buffer, limit+1, k-1)=2) then
+ if multistrlen(buffer, limit+1, k-1)=2 then
begin cat:=kcat_code(kcatcodekey(fromBUFF(buffer, limit+1, k-1))); incr(k);
end
else cat:=cat_code(cur_chr);
@@ -1712,7 +1712,7 @@ end
@y
@ @<Scan ahead in the buffer...@>=
begin repeat cur_chr:=buffer[k]; incr(k);
- if (multistrlen(buffer, limit+1, k-1)=2) then
+ if multistrlen(buffer, limit+1, k-1)=2 then
begin cat:=kcat_code(kcatcodekey(fromBUFF(buffer, limit+1, k-1))); incr(k);
end
else cat:=cat_code(cur_chr);
@@ -1980,8 +1980,8 @@ else
@x [26.424] l.8510 - pTeX: disp_node
@<Fetch an item in the current node...@>=
@y
-@d find_effective_tail_pTeX(#)== {Ignore final |disp_node|}
-if (type(tail)=disp_node) then
+@d find_effective_tail_pTeX(#)== {sets |tx| to last non-|disp_node|}
+if type(tail)=disp_node then
if is_char_node(prev_node)or(prev_node=head) then #
else tx:=prev_node
else tx:=tail
@@ -2031,7 +2031,7 @@ end;
@y
procedure scan_char_num;
begin scan_int;
-if (not is_char_ascii(cur_val))and(not check_kanji(cur_val)) then {wchar_token}
+if not is_char_ascii(cur_val)and not check_kanji(cur_val) then {wchar_token}
begin print_err("Bad character code");
@.Bad character code@>
help2("A character number must be between 0 and 255, or KANJI code.")@/
@@ -2122,7 +2122,7 @@ else if scan_keyword("sp") then goto done
if t=" " then t:=space_token
else t:=other_token+t;
@y
- if (multistrlen(str_pool, pool_ptr, k)=2) then
+ if multistrlen(str_pool, pool_ptr, k)=2 then
begin t:=fromBUFF(str_pool, pool_ptr, k); incr(k);
end
else if t=" " then t:=space_token
@@ -3788,7 +3788,7 @@ delete_glue_ref(cur_kanji_skip); delete_glue_ref(cur_xkanji_skip);
cur_kanji_skip:=space_ptr(head); cur_xkanji_skip:=xspace_ptr(head);
add_glue_ref(cur_kanji_skip); add_glue_ref(cur_xkanji_skip);
link(temp_head):=link(head);
-if (not is_char_node(tail))and(type(tail)=disp_node) then
+if not is_char_node(tail)and(type(tail)=disp_node) then
begin free_node(tail,small_node_size); tail:=prev_node; link(tail):=null
end;
if is_char_node(tail) then tail_append(new_penalty(inf_penalty))
@@ -4015,7 +4015,7 @@ end
else if (type(prev_p)=kern_node)and(subtype(prev_p)<>explicit) then
try_break(0,unhyphenated);
@y
- else if (type(prev_p)=kern_node) then
+ else if type(prev_p)=kern_node then
if (subtype(prev_p)<>explicit)and(subtype(prev_p)<>ita_kern) then
try_break(0,unhyphenated);
@z
@@ -4221,7 +4221,7 @@ if p<>null then if type(p)=hlist_node then
begin print_err("Insertions can only be added to a vbox");
@y
begin p:=box(n);
-if p<>null then if (type(p)=dir_node) then
+if p<>null then if type(p)=dir_node then
begin p:=list_ptr(p);
delete_glue_ref(space_ptr(box(n)));
delete_glue_ref(xspace_ptr(box(n)));
@@ -4485,7 +4485,7 @@ end
@x [46.1041] l.20999 - pTeX: disp_node
link(tail):=temp_ptr; tail:=temp_ptr;
@y
-if (not is_char_node(tail))and(type(tail)=disp_node) then
+if not is_char_node(tail)and(type(tail)=disp_node) then
begin link(prev_node):=temp_ptr; link(temp_ptr):=tail; prev_node:=temp_ptr;
end
else begin link(tail):=temp_ptr; tail:=temp_ptr;
@@ -4495,7 +4495,7 @@ else begin link(tail):=temp_ptr; tail:=temp_ptr;
@x [46.1043] l.21029 - pTeX: disp_node
link(tail):=q; tail:=q;
@y
-if (not is_char_node(tail))and(type(tail)=disp_node) then
+if not is_char_node(tail)and(type(tail)=disp_node) then
begin link(prev_node):=q; link(q):=tail; prev_node:=q;
end
else begin link(tail):=q; tail:=q;
@@ -4508,7 +4508,7 @@ tail_append(new_kern(cur_val)); subtype(tail):=s;
end;
@y
begin s:=cur_chr; scan_dimen(s=mu_glue,false,false);
-if (not is_char_node(tail))and(type(tail)=disp_node) then
+if not is_char_node(tail)and(type(tail)=disp_node) then
begin prev_append(new_kern(cur_val)); subtype(prev_node):=s;
end
else
@@ -4634,9 +4634,9 @@ q:pointer;
@!m:quarterword; {the length of a replacement list}
@y
@!r:pointer; {running behind |p|}
-@!a_dir:eight_bits; {adjust direction}
-@!disp,@!pdisp:scaled; {displacement}
@!fd:boolean; {a final |disp_node| pair?}
+@!disp,@!pdisp:scaled; {displacement}
+@!a_dir:eight_bits; {adjust direction}
@!tx:pointer; {effective tail node}
@!m:quarterword; {the length of a replacement list}
@z
@@ -4652,7 +4652,7 @@ 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 fetch_effective_tail_pTeX(#)==
+@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;
if not is_char_node(q) then
@@ -4661,13 +4661,12 @@ if not is_char_node(q) then
if p=tx then #;
end
else if type(q)=disp_node then
- begin pdisp:=disp; disp:=disp_dimen(q); fd:=true;
- end;
+ begin pdisp:=disp; disp:=disp_dimen(q); fd:=true;@+end;
q:=link(p);
-until q=tx;
+until q=tx; {found |r|$\to$|p|$\to$|q=tx|}
q:=link(tx); link(p):=q; link(tx):=null;
if q=null then tail:=p
-else if fd then
+else if fd then {|r|$\to$|p=disp_node|$\to$|q=disp_node|}
begin prev_node:=r; prev_disp:=pdisp; link(p):=null; tail:=p;
disp_dimen(p):=disp_dimen(q); free_node(q,small_node_size);
end
@@ -4685,7 +4684,8 @@ else begin if not is_char_node(tail) then
@y
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
+ 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
@@ -4855,7 +4855,7 @@ insert_group: begin end_graf; q:=split_top_skip; add_glue_ref(q);
height(r):=height(p)+depth(p); ins_ptr(r):=list_ptr(p);
split_top_ptr(r):=q; depth(r):=d; float_cost(r):=f;
ins_dir(r):=box_dir(p);
- if (not is_char_node(tail))and(type(tail)=disp_node) then
+ if not is_char_node(tail)and(type(tail)=disp_node) then
prev_append(r)
else tail_append(r);
end
@@ -4868,7 +4868,7 @@ insert_group: begin end_graf; q:=split_top_skip; add_glue_ref(q);
else begin
r:=get_node(small_node_size); type(r):=adjust_node;@/
adjust_ptr(r):=list_ptr(p); delete_glue_ref(q);
- if (not is_char_node(tail))and(type(tail)=disp_node) then
+ if not is_char_node(tail)and(type(tail)=disp_node) then
prev_append(r)
else tail_append(r);
end;
@@ -4884,7 +4884,7 @@ insert_group: begin end_graf; q:=split_top_skip; add_glue_ref(q);
mark_ptr(p):=def_ref; link(tail):=p; tail:=p;
@y
mark_ptr(p):=def_ref;
-if (not is_char_node(tail))and(type(tail)=disp_node) then
+if not is_char_node(tail)and(type(tail)=disp_node) then
prev_append(p)
else tail_append(p);
@z
@@ -4897,7 +4897,7 @@ end;
@y
procedure append_penalty;
begin scan_int;
- if (not is_char_node(tail))and(type(tail)=disp_node) then
+ if not is_char_node(tail)and(type(tail)=disp_node) then
prev_append(new_penalty(cur_val))
else tail_append(new_penalty(cur_val));
if mode=vmode then build_page;
@@ -4908,8 +4908,8 @@ end;
@!m:quarterword; {the length of a replacement list}
@y
@!r:pointer; {running behind |p|}
-@!disp,@!pdisp:scaled; {displacement}
@!fd:boolean; {a final |disp_node| pair?}
+@!disp,@!pdisp:scaled; {displacement}
@!tx:pointer; {effective tail node}
@!m:quarterword; {the length of a replacement list}
@z
@@ -5039,7 +5039,7 @@ var p:pointer; {|char_node| at the tail of the current list}
@!d:pointer; {|disp_node|}
begin if tail<>head then
begin
- if (not is_char_node(tail))and(type(tail)=disp_node) then
+ if not is_char_node(tail)and(type(tail)=disp_node) then
begin d:=tail; tail:=prev_node;
end
else d:=null;
@@ -5093,7 +5093,7 @@ var s,@!t: real; {amount of slant}
begin scan_char_num; f:=cur_font; p:=new_character(f,cur_val);
@y
begin scan_char_num;
-if (not is_char_ascii(cur_val)) then
+if not is_char_ascii(cur_val) then
begin KANJI(cx):=cur_val;
if direction=dir_tate then f:=cur_tfont else f:=cur_jfont;
p:=new_character(f,get_jfm_pos(KANJI(cx),f));
@@ -6076,7 +6076,7 @@ end;
@ @<Assignments@>=
assign_kinsoku:
begin p:=cur_chr; scan_int; n:=cur_val; scan_optional_equals; scan_int;
-if (is_char_ascii(n) or check_kanji(n)) then
+if is_char_ascii(n) or check_kanji(n) then
begin j:=get_kinsoku_pos(tokanji(n),new_pos);
if j=no_entry then
begin print_err("KINSOKU table is full!!");
@@ -6092,8 +6092,8 @@ if (is_char_ascii(n) or check_kanji(n)) then
end
else
begin print_err("Invalid KANJI code for ");
- if (p=pre_break_penalty_code) then print("pre")
- else if (p=post_break_penalty_code) then print("post")
+ if p=pre_break_penalty_code then print("pre")
+ else if p=post_break_penalty_code then print("post")
else print_char("?");
print("breakpenalty ("); print_hex(n); print_char(")");
@.Invalid KANJI code@>
@@ -6113,16 +6113,16 @@ end
@<Insert kinsoku penalty@>=
begin kp:=get_kinsoku_pos(cx,cur_pos);
-if (kp<>no_entry) then
- begin if (kinsoku_type(kp)=pre_break_penalty_code) then
- begin if (not is_char_node(cur_q))and(type(cur_q)=penalty_node) then
+if kp<>no_entry then
+ begin if kinsoku_type(kp)=pre_break_penalty_code then
+ begin if not is_char_node(cur_q)and(type(cur_q)=penalty_node) then
penalty(cur_q):=penalty(cur_q)+kinsoku_penalty(kp)
else
begin main_p:=link(cur_q); link(cur_q):=new_penalty(kinsoku_penalty(kp));
subtype(link(cur_q)):=kinsoku_pena; link(link(cur_q)):=main_p;
end;
end
- else if (kinsoku_type(kp)=post_break_penalty_code) then
+ else if kinsoku_type(kp)=post_break_penalty_code then
begin tail_append(new_penalty(kinsoku_penalty(kp)));
subtype(tail):=kinsoku_pena;
end;
@@ -6131,9 +6131,9 @@ end;
@ @<Insert |pre_break_penalty| of |cur_chr|@>=
begin kp:=get_kinsoku_pos(cur_chr,cur_pos);
-if (kp<>no_entry) then
- begin if (kinsoku_type(kp)=pre_break_penalty_code) then
- if (not is_char_node(tail))and(type(tail)=penalty_node) then
+if kp<>no_entry then
+ begin if kinsoku_type(kp)=pre_break_penalty_code then
+ if not is_char_node(tail)and(type(tail)=penalty_node) then
penalty(tail):=penalty(tail)+kinsoku_penalty(kp)
else
begin tail_append(new_penalty(kinsoku_penalty(kp)));
@@ -6144,8 +6144,8 @@ end;
@ @<Insert |post_break_penalty|@>=
begin kp:=get_kinsoku_pos(cx,cur_pos);
-if (kp<>no_entry) then
- begin if (kinsoku_type(kp)=post_break_penalty_code) then
+if kp<>no_entry then
+ begin if kinsoku_type(kp)=post_break_penalty_code then
begin tail_append(new_penalty(kinsoku_penalty(kp)));
subtype(tail):=kinsoku_pena;
end;
@@ -6293,7 +6293,7 @@ if auto_xspacing>0 then
end;
u:=space_ptr(p); add_glue_ref(u);
s:=xspace_ptr(p); add_glue_ref(s);
-if (not is_char_node(link(p))) {p1.0.9d}
+if not is_char_node(link(p)) {p1.0.9d}
and(type(link(p))=glue_node)and(subtype(link(p))=jfm_skip+1) then
begin v:=link(p); link(p):=link(v);
fast_delete_glue_ref(glue_ptr(v)); free_node(v,small_node_size);
@@ -6303,7 +6303,7 @@ while p<>null do
begin if is_char_node(p) then
begin repeat @<Insert a space around the character |p|@>;
q:=p; p:=link(p); incr(i);
- if (i>5)and(pf) then
+ if (i>5)and pf then
begin if is_char_node(v) then
if font_dir[font(v)]<>dir_default then v:=link(v);
v:=link(v);
@@ -6315,8 +6315,8 @@ while p<>null do
hlist_node: @<Insert hbox surround spacing@>;
ligature_node: @<Insert ligature surround spacing@>;
penalty_node,disp_node: @<Insert penalty or displace surround spacing@>;
- kern_node: if (subtype(p)=explicit) then insert_skip:=no_skip
- else if (subtype(p)=acc_kern) then begin
+ kern_node: if subtype(p)=explicit then insert_skip:=no_skip
+ else if subtype(p)=acc_kern then begin
{ When we insert \.{\\xkanjiskip}, we first ignore accent (and kerns) and
insert \.{\\xkanjiskip}, then we recover the accent. }
if q=p then begin t:=link(p);
@@ -6334,7 +6334,7 @@ while p<>null do
if font_dir[font(t)]<>dir_default then t:=link(t);
t:=link(link(t)); link(q):=t; p:=t;
@<Insert a space around the character |p|@>; incr(i);
- if (i>5)and(pf) then
+ if (i>5)and pf then
begin if is_char_node(v) then
if font_dir[font(v)]<>dir_default then v:=link(v);
v:=link(v);
@@ -6351,12 +6351,12 @@ while p<>null do
q:=p; p:=link(p);
end;
end;
-if (not is_char_node(q))and(type(q)=glue_node)and(subtype(q)=jfm_skip+1) then
+if not is_char_node(q)and(type(q)=glue_node)and(subtype(q)=jfm_skip+1) then
begin fast_delete_glue_ref(glue_ptr(q));
glue_ptr(q):=zero_glue; add_glue_ref(zero_glue);
end;
delete_glue_ref(u); delete_glue_ref(s);
-if (v<>null)and(pf)and(i>5) then @<Make |jchr_widow_penalty| node@>;
+if (v<>null)and pf and(i>5) then @<Make |jchr_widow_penalty| node@>;
exit:
end;
@@ -6375,7 +6375,7 @@ else
@ @<Insert hbox surround spacing@>=
begin find_first_char:=true; first_char:=null; last_char:=null;
-if (shift_amount(p)=0) then
+if shift_amount(p)=0 then
begin if check_box(list_ptr(p)) then
begin if first_char<>null then @<Insert a space before the |first_char|@>;
if last_char<>null then
@@ -6402,7 +6402,7 @@ else
@ @<Insert a space after the |last_char|@>=
if font_dir[font(last_char)]<>dir_default then
begin insert_skip:=after_wchar;
- if (is_char_node(link(p)))and(font_dir[font(link(p))]<>dir_default) then
+ if is_char_node(link(p))and(font_dir[font(link(p))]<>dir_default) then
begin @<Append KANJI-KANJI spacing@>; p:=link(p);
end;
end
@@ -6417,7 +6417,7 @@ begin if (subtype(p)=before)and(insert_skip=after_wchar) then
begin ax:=qo("0"); @<Insert KANJI-ASCII spacing@>;
insert_skip:=no_skip;
end
-else if (subtype(p)=after) then
+else if subtype(p)=after then
begin ax:=qo("0"); insert_skip:=after_schar;
end
else insert_skip:=no_skip;
@@ -6498,16 +6498,16 @@ end
@ @<Make |jchr_widow_penalty| node@>=
begin q:=v; p:=link(v);
-if (is_char_node(v))and(font_dir[font(v)]<>dir_default) then
+if is_char_node(v)and(font_dir[font(v)]<>dir_default) then
begin q:=p; p:=link(p);
end;
t:=q; s:=null;
@<Seek list and make |t| pointing widow penalty position@>;
-if (s<>null) then
+if s<>null then
begin s:=link(t);
- if (not is_char_node(s))and(type(s)=penalty_node) then
+ if not is_char_node(s)and(type(s)=penalty_node) then
penalty(s):=penalty(s)+jchr_widow_penalty
- else if (jchr_widow_penalty<>0) then
+ else if jchr_widow_penalty<>0 then
begin s:=new_penalty(jchr_widow_penalty); subtype(s):=widow_pena;
link(s):=link(t); link(t):=s; t:=link(s);
while(not is_char_node(t)) do
@@ -6688,9 +6688,9 @@ again_2:
main_loop_j+3:
if ins_kp=true then @<Insert |pre_break_penalty| of |cur_chr|@>;
@<Look ahead for glue or kerning@>;
- if (ins_kp=false) then begin { Kanji -> Kanji }
+ if ins_kp=false then begin { Kanji -> Kanji }
goto main_loop_j+1;
- end else if (ins_kp=true) then begin { Kanji -> Ascii }
+ end else if ins_kp=true then begin { Kanji -> Ascii }
{@<Append |disp_node| at begin of displace area@>;}
ins_kp:=false; goto main_loop;
end else begin { Kanji -> cs }
@@ -6699,7 +6699,7 @@ main_loop_j+3:
end;
@ @<Append |disp_node| at begin ...@>=
-begin if (not is_char_node(tail))and(type(tail)=disp_node) then
+begin if not is_char_node(tail)and(type(tail)=disp_node) then
begin if prev_disp=disp then
begin free_node(tail,small_node_size); tail:=prev_node; link(tail):=null;
end
@@ -6714,7 +6714,7 @@ end;
@ @<Append |disp_node| at end ...@>=
if disp<>0 then
-begin if (not is_char_node(tail))and(type(tail)=disp_node) then
+begin if not is_char_node(tail)and(type(tail)=disp_node) then
begin disp_dimen(tail):=0;
end
else