diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-03-23 08:31:15 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-03-23 08:31:15 +0000 |
commit | 161cc5508f7aa14ffe0713f3d3e4979b551ca6c4 (patch) | |
tree | 996c83e64b73b92bb016141f29427992894530b8 /Build/source/texk/web2c | |
parent | 95f04855eb17eb020d1d8c8417d3bd09e649c569 (diff) |
e-TeX, pTeX, and e-pTeX: reformulate/simplify \lastpenalty & Co
git-svn-id: svn://tug.org/texlive/trunk@21810 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c')
-rw-r--r-- | Build/source/texk/web2c/eptexdir/ChangeLog.TL | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/eptexdir/eptex.ech | 50 | ||||
-rw-r--r-- | Build/source/texk/web2c/eptexdir/etex.ch0 | 46 | ||||
-rw-r--r-- | Build/source/texk/web2c/etexdir/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/etexdir/etex.ch | 95 | ||||
-rw-r--r-- | Build/source/texk/web2c/ptexdir/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/ptexdir/ptex-base.ch | 48 |
7 files changed, 169 insertions, 85 deletions
diff --git a/Build/source/texk/web2c/eptexdir/ChangeLog.TL b/Build/source/texk/web2c/eptexdir/ChangeLog.TL index 6486175f987..89271a45d09 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-22 Peter Breitenlohner <peb@mppmu.mpg.de> + + * eptex.ech, etex.ch0: Reformulate @<Fetch an item in the + current node...@> to reduce interferences between e-TeX and pTeX. + 2011-03-18 Peter Breitenlohner <peb@mppmu.mpg.de> e-pTeX update eptex-110315_tlsvn110318.diff [ptex:00248] diff --git a/Build/source/texk/web2c/eptexdir/eptex.ech b/Build/source/texk/web2c/eptexdir/eptex.ech index 3c16e9b26bb..a1df317dbcf 100644 --- a/Build/source/texk/web2c/eptexdir/eptex.ech +++ b/Build/source/texk/web2c/eptexdir/eptex.ech @@ -39,25 +39,43 @@ @d set_box_dir(#) == subtype(#):=(subtype(#)div 8)*8+set_box_dir_end @z +@x [26.424] l.8510 - e-pTeX: last node +@d set_effective_tail==set_effective_tail_pTeX +@y +@d set_effective_tail_epTeX(#)== {Ignore final |disp_node| and\slash or \.{\\endM} node} +set_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 is_char_node(q)or(q=head) then # + else tx:=q + else tx:=r; + end +@# +@d set_effective_tail==set_effective_tail_epTeX +@z + +@x [26.424] l.8517 - e-pTeX: node types + if (tail=head)or(mode=0) then cur_val:=-1; +@y + if (tail=head)or(mode=0)or@| + ((tail=link(head))and not is_char_node(tail)and(type(tail)=disp_node)) + then cur_val:=-1; +@z + @x [26.424] e-pTeX: node types - last_node_type_code: - if (type(tail)<>math_node)or(subtype(tail)<>end_M_code) then - if type(tail)<=unset_node then cur_val:=type(tail)+1 + last_node_type_code: if type(tx)<=unset_node then cur_val:=type(tx)+1 else cur_val:=unset_node+2; - end; {there are no other cases} - end @y - last_node_type_code: - if ((type(q)<>math_node)or(subtype(q)<>end_M_code))and(head<>tail) then - if type(q)<=unset_node then begin - if type(q)=dir_node then q:=list_ptr(q); - cur_val:=type(q); - if cur_val<dir_node then cur_val:=cur_val+1 - 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|} - end; {there are no other cases} - end; + last_node_type_code: if type(tx)<=unset_node then + begin if type(tx)=dir_node then tx:=list_ptr(tx); + cur_val:=type(tx); + if cur_val<dir_node then cur_val:=cur_val+1 + 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|} @z @x e-pTeX: if primitives - leave room for three e-TeX codes diff --git a/Build/source/texk/web2c/eptexdir/etex.ch0 b/Build/source/texk/web2c/eptexdir/etex.ch0 index 4b5b8365104..124e04796f6 100644 --- a/Build/source/texk/web2c/eptexdir/etex.ch0 +++ b/Build/source/texk/web2c/eptexdir/etex.ch0 @@ -10,6 +10,22 @@ @d count_base=int_base+int_pars {256 user \.{\\count} registers} @z +@x [26.413] + {fetch an internal parameter} +label exit; +var m:halfword; {|chr_code| part of the operand token} +@!tx:pointer; {effective tail node} +@y + {fetch an internal parameter} +var m:halfword; {|chr_code| part of the operand token} +@z + +@x [26.413] +exit:end; +@y +end; +@z + @x [26.420] if q=null then cur_val:=0 @+else cur_val:=mem[q+m].sc; @y @@ -17,10 +33,34 @@ if box(cur_val)=null then cur_val:=0 @+else cur_val:=mem[box(cur_val)+m].sc; @z @x [26.424] - else cur_val:=unset_node+2; - end; {there are no other cases} +@d set_effective_tail==set_effective_tail_eTeX + +@y +@z + +@x [26.424] + begin set_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); + glue_val: if type(tx)=glue_node then + begin cur_val:=glue_ptr(tx); + if subtype(tx)=mu_glue then cur_val_level:=mu_val; + end; +@y + case cur_chr of + int_val: if type(tail)=penalty_node then cur_val:=penalty(tail); + dimen_val: if type(tail)=kern_node then cur_val:=width(tail); + glue_val: if type(tail)=glue_node then + begin cur_val:=glue_ptr(tail); + if subtype(tail)=mu_glue then cur_val_level:=mu_val; + end; +@z + +@x [26.424] + end; {there are no other cases} + end @y - else cur_val:=unset_node+2; end {there are no other cases} @z diff --git a/Build/source/texk/web2c/etexdir/ChangeLog b/Build/source/texk/web2c/etexdir/ChangeLog index e8a7bd6d899..f920e22fe27 100644 --- a/Build/source/texk/web2c/etexdir/ChangeLog +++ b/Build/source/texk/web2c/etexdir/ChangeLog @@ -1,3 +1,8 @@ +2011-03-22 Peter Breitenlohner <peb@mppmu.mpg.de> + + * etex.ch: Reformulate @<Fetch an item in the current node...@> + to reduce interferences between e-TeX and pTeX. + 2011-03-18 Peter Breitenlohner <peb@mppmu.mpg.de> * etex.ch: Define and use the Web macros box_lrstat and diff --git a/Build/source/texk/web2c/etexdir/etex.ch b/Build/source/texk/web2c/etexdir/etex.ch index 8bc763d5063..924b9abf336 100644 --- a/Build/source/texk/web2c/etexdir/etex.ch +++ b/Build/source/texk/web2c/etexdir/etex.ch @@ -3,33 +3,7 @@ % to be applied to tex.web in order to define the % e-TeX program. -% Note: This file defines etex.web in terms of changes to be applied to -% tex.web; in terms of a program such as TIE (or equivalent), directories -% may vary: -% -% tex.web ) -% + ) => tie -m ... => etex.web -% etexdir/etex.ch ) -% -% In addition, this file is used to define pdfetex.web, a combination -% of e-TeX and pdfTeX as follows: -% -% tex.web ) -% + ) -% etexdir/etex.ch ) -% + ) -% pdfetexdir/pdfetex.ch1 ) => tie -m ... => pdfetex.web -% + ) -% pdftexdir/pdftex.ch ) -% + ) -% pdfetexdir/pdfetex.ch2 ) -% -% where the two (small) files pdfetexdir/pdfetex.ch[12] take care of -% interferences between e-Tex changes (etexdir/etex.ch) and pdfTeX changes -% (pdftexdir/pdftex.ch). Consequently, changes in these files have to be -% coordinated. - -% e-TeX is copyright (C) 1999-2010 by P. Breitenlohner (1994,98 by the NTS +% e-TeX is copyright (C) 1999-2011 by P. Breitenlohner (1994,98 by the NTS % team); all rights are reserved. Copying of this file is authorized only if % (1) you are P. Breitenlohner, or if (2) you make absolutely no changes to % your copy. (Programs such as TIE allow the application of several change @@ -55,7 +29,7 @@ % TeX is a trademark of the American Mathematical Society. % METAFONT is a trademark of Addison-Wesley Publishing Company. @y -% e-TeX is copyright (C) 1999-2010 by P. Breitenlohner (1994,98 by the NTS +% e-TeX is copyright (C) 1999-2011 by P. Breitenlohner (1994,98 by the NTS % team); all rights are reserved. Copying of this file is authorized only if % (1) you are P. Breitenlohner, or if (2) you make absolutely no changes to % your copy. (Programs such as TIE allow the application of several change @@ -121,8 +95,8 @@ % fixed the error messages for improper use of \protected, % reported by Heiko Oberdiek % <heiko.oberdiek@@googlemail.com>, May 2010. -% some trivial rearrangements to reduce interferences between -% e-TeX and pTeX, suggested by Hironori Kitagawa +% some rearrangements to reduce interferences between +% e-TeX and pTeX, in part suggested by Hironori Kitagawa % <h_kitagawa2001@yahoo.co.jp>, Mar 2011. % Although considerable effort has been expended to make the e-TeX program @@ -1109,6 +1083,7 @@ var m:halfword; {|chr_code| part of the operand token} @y label exit; var m:halfword; {|chr_code| part of the operand token} +@!tx:pointer; {effective tail node} @!q:halfword; {general purpose index} @!i:four_quarters; {character info} @z @@ -1197,11 +1172,27 @@ begin if m>par_shape_loc then @<Fetch a penalties array element@> else if par_shape_ptr=null then cur_val:=0 @z %--------------------------------------- -@x [26] m.424 l.8505 - e-TeX TeXXeT -implemented. The reference count for \.{\\lastskip} will be updated later. +@x [26] m.424 l.8504 - e-TeX \lastnodetype +@ Here is where \.{\\lastpenalty}, \.{\\lastkern}, and \.{\\lastskip} are @y -implemented. The reference count for \.{\\lastskip} will be updated later. -A final \.{\\endM} node is temporarily removed. +@ Here is where \.{\\lastpenalty}, \.{\\lastkern}, \.{\\lastskip}, and +\.{\\lastnodetype} are +@z +%--------------------------------------- +@x [26] m.424 l.8510 - e-TeX TeXXeT +@<Fetch an item in the current node...@>= +@y +@d set_effective_tail_eTeX(#)== {Ignore final \.{\\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); + if is_char_node(tx) then #; + end +else tx:=tail +@# +@d set_effective_tail==set_effective_tail_eTeX + +@<Fetch an item in the current node...@>= @z %--------------------------------------- @x [26] m.424 l.8511 - e-TeX basic @@ -1238,29 +1229,27 @@ if m>=input_line_no_code then else cur_val_level:=cur_chr; @z %--------------------------------------- -@x [26] m.424 l.8519 - e-TeX TeXXeT - case cur_chr of -@y - begin if (type(tail)=math_node)and(subtype(tail)=end_M_code) then - remove_end_M; +@x [26] m.424 l.8519 - e-TeX TeXXeT, last_node_type case cur_chr of -@z -%--------------------------------------- -@x [26] m.424 l.8525 - e-TeX last_node_type - end; -@y + int_val: if type(tail)=penalty_node then cur_val:=penalty(tail); + dimen_val: if type(tail)=kern_node then cur_val:=width(tail); + glue_val: if type(tail)=glue_node then + begin cur_val:=glue_ptr(tail); + if subtype(tail)=mu_glue then cur_val_level:=mu_val; end; - last_node_type_code: - if (type(tail)<>math_node)or(subtype(tail)<>end_M_code) then - if type(tail)<=unset_node then cur_val:=type(tail)+1 - else cur_val:=unset_node+2; -@z -%--------------------------------------- -@x [26] m.424 l.8526 - e-TeX TeXXeT end {there are no other cases} @y - end; {there are no other cases} - if LR_temp<>null then insert_end_M; + begin set_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); + glue_val: if type(tx)=glue_node then + begin cur_val:=glue_ptr(tx); + if subtype(tx)=mu_glue then cur_val_level:=mu_val; + end; + last_node_type_code: if type(tx)<=unset_node then cur_val:=type(tx)+1 + else cur_val:=unset_node+2; + end; {there are no other cases} end @z %--------------------------------------- diff --git a/Build/source/texk/web2c/ptexdir/ChangeLog b/Build/source/texk/web2c/ptexdir/ChangeLog index 08d46be7319..82fa221fe64 100644 --- a/Build/source/texk/web2c/ptexdir/ChangeLog +++ b/Build/source/texk/web2c/ptexdir/ChangeLog @@ -1,3 +1,8 @@ +2011-03-22 Peter Breitenlohner <peb@mppmu.mpg.de> + + * ptex-base.ch: Reformulate @<Fetch an item in the current + node...@> to reduce interferences between e-TeX and pTeX. + 2011-03-18 Peter Breitenlohner <peb@mppmu.mpg.de> e-pTeX update eptex-110315_tlsvn110318.diff [ptex:00248] diff --git a/Build/source/texk/web2c/ptexdir/ptex-base.ch b/Build/source/texk/web2c/ptexdir/ptex-base.ch index 179643abe83..1d6a2b05a71 100644 --- a/Build/source/texk/web2c/ptexdir/ptex-base.ch +++ b/Build/source/texk/web2c/ptexdir/ptex-base.ch @@ -1914,13 +1914,20 @@ if cur_cs=0 then else cur_tok:=cs_token_flag+cur_cs; @z -@x [26.413] l.8659 - pTeX: scan_somthing_internal +@x [26.413] l.8341 - pTeX: scan_somthing_internal @p procedure scan_something_internal(@!level:small_number;@!negative:boolean); @y @p @t\4@>@<Declare procedures needed in |scan_something|@>@t@>@/ procedure scan_something_internal(@!level:small_number;@!negative:boolean); @z -@x [26.413] l.8663 - pTeX: scan_somthing_internal +@x [26.413] l.8343 - pTeX: scan_somthing_internal +var m:halfword; {|chr_code| part of the operand token} +@y +label exit; +var m:halfword; {|chr_code| part of the operand token} +@!tx:pointer; {effective tail node} +@z +@x [26.413] l.8345 - pTeX: scan_somthing_internal begin m:=cur_chr; case cur_cmd of def_code: @<Fetch a character code from some table@>; @@ -1937,7 +1944,7 @@ toks_register,assign_toks,def_family,set_font,def_font,def_jfont,def_tfont: @<Fetch a token list or font identifier, provided that |level=tok_val|@>; @z -@x [26.414] l.8693 - pTeX: +@x [26.414] l.8373 - pTeX: if m=math_code_base then scanned_result(ho(math_code(cur_val)))(int_val) else if m<math_code_base then scanned_result(equiv(m+cur_val))(int_val) else scanned_result(eqtb[m+cur_val].int)(int_val); @@ -1952,7 +1959,7 @@ else if m<math_code_base then else scanned_result(eqtb[m+cur_val].int)(int_val); @z -@x [26.420] l.8799 - pTeX: Fetch a box dimension: dir_node +@x [26.420] l.8475 - pTeX: Fetch a box dimension: dir_node if box(cur_val)=null then cur_val:=0 @+else cur_val:=mem[box(cur_val)+m].sc; @y if box(cur_val)=null then cur_val:=0 @@ -1970,7 +1977,22 @@ else end; @z -@x [26.424] l.8690 - pTeX: Fetch an item ...: disp_node +@x [26.424] l.8510 - pTeX: disp_node +@<Fetch an item in the current node...@>= +@y +@d set_effective_tail_pTeX(#)== {Ignore final |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 +@# +@d set_effective_tail==set_effective_tail_pTeX + +@<Fetch an item in the current node...@>= +@z + +@x [26.424] l.8518 - pTeX: Fetch an item ...: disp_node + if not is_char_node(tail)and(mode<>0) then case cur_chr of int_val: if type(tail)=penalty_node then cur_val:=penalty(tail); dimen_val: if type(tail)=kern_node then cur_val:=width(tail); @@ -1979,17 +2001,17 @@ else if subtype(tail)=mu_glue then cur_val_level:=mu_val; end; @y - begin if (type(tail)=disp_node)and not is_char_node(prev_node) then q:=prev_node - else q:=tail; + if not is_char_node(tail)and(tail<>head)and(mode<>0) then + begin set_effective_tail(return); case cur_chr of - int_val: if type(q)=penalty_node then cur_val:=penalty(q); - dimen_val: if type(q)=kern_node then cur_val:=width(q); - glue_val: if type(q)=glue_node then - begin cur_val:=glue_ptr(q); - if subtype(q)=mu_glue then cur_val_level:=mu_val; + int_val: if type(tx)=penalty_node then cur_val:=penalty(tx); + dimen_val: if type(tx)=kern_node then cur_val:=width(tx); + glue_val: if type(tx)=glue_node then + begin cur_val:=glue_ptr(tx); + if subtype(tx)=mu_glue then cur_val_level:=mu_val; end; @z -@x [26.424] l.8690 - pTeX: Fetch an item ...: disp_node +@x [26.424] l.8526 - pTeX: Fetch an item ...: disp_node end {there are no other cases} @y end; {there are no other cases} |