From 753e0c4f39129e25b87974d1b63daddd1b8384d9 Mon Sep 17 00:00:00 2001 From: Hironobu Yamashita Date: Sat, 23 Sep 2017 22:07:26 +0000 Subject: eptexdir: fix \[if]pdfprimitive (version 170924 by H. Kitagawa) git-svn-id: svn://tug.org/texlive/trunk@45386 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/eptexdir/ChangeLog | 5 +++ Build/source/texk/web2c/eptexdir/eptex.ech | 2 +- Build/source/texk/web2c/eptexdir/pdfutils.ch | 52 +++++++++++++++------------- 3 files changed, 34 insertions(+), 25 deletions(-) (limited to 'Build/source/texk') diff --git a/Build/source/texk/web2c/eptexdir/ChangeLog b/Build/source/texk/web2c/eptexdir/ChangeLog index 5d5f963409d..da1ef09eb97 100644 --- a/Build/source/texk/web2c/eptexdir/ChangeLog +++ b/Build/source/texk/web2c/eptexdir/ChangeLog @@ -1,3 +1,8 @@ +2017-09-24 Hironori Kitagawa + + * pdfutils.ch: Avoid overwriting prim_* entries by primitive(). + * eptex.ech: Change version to 170924. + 2017-09-09 Hironori Kitagawa and Noriyuki Abe diff --git a/Build/source/texk/web2c/eptexdir/eptex.ech b/Build/source/texk/web2c/eptexdir/eptex.ech index af94d280aad..57592ac0308 100644 --- a/Build/source/texk/web2c/eptexdir/eptex.ech +++ b/Build/source/texk/web2c/eptexdir/eptex.ech @@ -19,7 +19,7 @@ @y @d eTeX_version_string=='-2.6' {current \eTeX\ version} @# -@d epTeX_version_string=='-161114' +@d epTeX_version_string=='-170924' @z @x e-pTeX: banner diff --git a/Build/source/texk/web2c/eptexdir/pdfutils.ch b/Build/source/texk/web2c/eptexdir/pdfutils.ch index 1591fa8a6f2..e7ed21e2f2a 100644 --- a/Build/source/texk/web2c/eptexdir/pdfutils.ch +++ b/Build/source/texk/web2c/eptexdir/pdfutils.ch @@ -20,9 +20,9 @@ %% %% \pdfprimitive and \ifpdfprimitive: for LaTeX3 (2015/07/15) %% -%% \pdfuniformdeviate and co.: +%% \pdfuniformdeviate and co.: %% (\pdfnormaldeviate, \pdfrandomseed, \pdfsetrandomseed) -%% +%% %% \pdfelapsedtime and \pdfresettimer %% @@ -449,7 +449,7 @@ pdf_page_height_code: print_esc("pdfpageheight"); @d prim_prime=1777 {about 85\pct! of |primitive_size|} @d prim_base=1 @d prim_next(#) == prim[#].lh {link for coalesced lists} -@d prim_text(#) == prim[#].rh {string number for control sequence name} +@d prim_text(#) == prim[#].rh {string number for control sequence name, plus one} @d prim_is_full == (prim_used=prim_base) {test if all positions are occupied} @d prim_eq_level_field(#)==#.hh.b1 @d prim_eq_type_field(#)==#.hh.b0 @@ -458,6 +458,7 @@ pdf_page_height_code: print_esc("pdfpageheight"); @d prim_eq_type(#)==prim_eq_type_field(prim_eqtb[#]) {command code for equivalent} @d prim_equiv(#)==prim_equiv_field(prim_eqtb[#]) {equivalent value} @d undefined_primitive=0 +@d biggest_char=255 { 65535 in XeTeX } @= @!prim: array [0..prim_size] of two_halves; {the primitives table} @@ -505,27 +506,30 @@ var h:integer; {hash code} @!k:pointer; {index in string pool} @!j,@!l:integer; begin -if s<256 then begin - p := s; - if (p<0) or (prim_eq_level(p)<>level_one) then - p := undefined_primitive; -end +if s<=biggest_char then begin + if s<0 then begin p:=undefined_primitive; goto found; end + else p:=(s mod prim_prime)+prim_base; {we start searching here} + end else begin j:=str_start[s]; if s = str_ptr then l := cur_length else l := length(s); @; - p:=h+prim_base; {we start searching here; note that |0<=h0 then if length(prim_text(p))=l then - if str_eq_str(prim_text(p),s) then goto found; - if prim_next(p)=0 then - begin if no_new_control_sequence then - p:=undefined_primitive - else @; - goto found; - end; - p:=prim_next(p); + p:=h+prim_base; {we start searching here; note that |0<=h1+biggest_char then { |p| points a multi-letter primitive } + begin if length(prim_text(p)-1)=l then + if str_eq_str(prim_text(p)-1,s) then goto found; + end + else if prim_text(p)=1+s then goto found; { |p| points a single-letter primitive } + if prim_next(p)=0 then + begin if no_new_control_sequence then + p:=undefined_primitive + else @; + goto found; end; + p:=prim_next(p); end; found: prim_lookup:=p; end; @@ -538,7 +542,7 @@ begin if prim_text(p)>0 then until prim_text(prim_used)=0; {search for an empty location in |prim|} prim_next(p):=prim_used; p:=prim_used; end; -prim_text(p):=s; +prim_text(p):=s+1; end @ The value of |prim_prime| should be roughly 85\pct! of @@ -569,7 +573,7 @@ begin if s<256 then cur_val:=s+single_base @y begin if s<256 then begin cur_val:=s+single_base; - prim_val:=s; + prim_val:=prim_lookup(s); end @z @@ -649,7 +653,7 @@ temporary file. begin save_scanner_status := scanner_status; scanner_status:=normal; get_token; scanner_status:=save_scanner_status; if cur_cs < hash_base then - cur_cs := prim_lookup(cur_cs-257) + cur_cs := prim_lookup(cur_cs-single_base) else cur_cs := prim_lookup(text(cur_cs)); if cur_cs<>undefined_primitive then begin @@ -996,7 +1000,7 @@ if_pdfprimitive_code: begin get_next; scanner_status:=save_scanner_status; if cur_cs < hash_base then - m := prim_lookup(cur_cs-257) + m := prim_lookup(cur_cs-single_base) else m := prim_lookup(text(cur_cs)); b :=((cur_cmd<>undefined_cs) and @@ -1029,7 +1033,7 @@ any_mode(ignore_spaces): begin get_next; scanner_status:=t; if cur_cs < hash_base then - cur_cs := prim_lookup(cur_cs-257) + cur_cs := prim_lookup(cur_cs-single_base) else cur_cs := prim_lookup(text(cur_cs)); if cur_cs<>undefined_primitive then begin -- cgit v1.2.3