Last active
November 10, 2017 01:51
-
-
Save h-kitagawa/8c0bb24f7436a9fb5c851358b577f054 to your computer and use it in GitHub Desktop.
\pdfprimitive で cur_tok を正しく設定させるテスト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/texk/web2c/eptexdir/tests/pdfprimitive-eptex.log b/texk/web2c/eptexdir/tests/pdfprimitive-eptex.log | |
index 898df1856..4bce55512 100644 | |
--- a/texk/web2c/eptexdir/tests/pdfprimitive-eptex.log | |
+++ b/texk/web2c/eptexdir/tests/pdfprimitive-eptex.log | |
@@ -1,25 +1,26 @@ | |
+This is e-pTeX, Version 3.14159265-p3.7.2-170924-2.6 (utf8.euc) (TeX Live 2018/dev) (preloaded format=eptex 2017.11.5) 6 NOV 2017 06:36 | |
entering extended mode | |
restricted \write18 enabled. | |
%&-line parsing enabled. | |
-**pdfprimitive-eptex | |
-(./pdfprimitive-eptex.tex | |
+**pdfprimitive-test | |
+(./pdfprimitive-test.tex | |
RELAX macro:->\message {RELAX} FUGA | |
! Missing primitive name. | |
<to be read again> | |
\fuga | |
-l.13 \pdfprimitive\fuga | |
+l.19 \pdfprimitive\fuga | |
% ==> ``! Missing primitive name.'' error | |
The control sequence marked <to be read again> does not | |
represent any known primitive. | |
FUGA F T F F F | |
> \pdfstrcmp=\pdfstrcmp. | |
-l.22 \show\pdfstrcmp | |
+l.28 \show\pdfstrcmp | |
% ==> \pdfstrcmp | |
T T | |
! Undefined control sequence. | |
-l.29 \setbox0=\vbox{\pdfprimitive\ \undefined | |
+l.35 \setbox0=\vbox{\pdfprimitive\ \undefined | |
} | |
The control sequence at the end of the top line | |
of your error message was never \def'ed. If you have | |
@@ -28,7 +29,7 @@ spelling (e.g., `I\hbox'). Otherwise just continue, | |
and I'll forget about whatever was undefined. | |
! Undefined control sequence. | |
-l.31 \setbox0=\vbox{\pdfprimitive\vrule\undefined | |
+l.37 \setbox0=\vbox{\pdfprimitive\vrule\undefined | |
} | |
The control sequence at the end of the top line | |
of your error message was never \def'ed. If you have | |
@@ -36,11 +37,44 @@ misspelled it (e.g., `\hobx'), type `I' and the correct | |
spelling (e.g., `I\hbox'). Otherwise just continue, | |
and I'll forget about whatever was undefined. | |
+! Missing primitive name. | |
+<to be read again> | |
+ \X | |
+l.42 \count42=\pdfprimitive\X | |
+ 1\A | |
+The control sequence marked <to be read again> does not | |
+represent any known primitive. | |
-Overfull \hbox (0.4pt too wide) in paragraph at lines 31--31 | |
-[]| | |
+! Undefined control sequence. | |
+<recently read> \X | |
+ | |
+l.42 \count42=\pdfprimitive\X | |
+ 1\A | |
+The control sequence at the end of the top line | |
+of your error message was never \def'ed. If you have | |
+misspelled it (e.g., `\hobx'), type `I' and the correct | |
+spelling (e.g., `I\hbox'). Otherwise just continue, | |
+and I'll forget about whatever was undefined. | |
-\hbox(0.0+0.0)x0.0 [] | |
+<1> | |
+! Missing number, treated as zero. | |
+<to be read again> | |
+ \- | |
+l.43 \count42=\pdfprimitive\- | |
+ 2\A | |
+A number should have been here; I inserted `0'. | |
+(If you can't figure out why I needed to see a number, | |
+look up `weird error' in the index to The TeXbook.) | |
+ | |
+<0> | |
+! Missing number, treated as zero. | |
+<to be read again> | |
+ \vrule | |
+l.44 \count42=\pdfprimitive\vrule | |
+ 3\A | |
+A number should have been here; I inserted `0'. | |
+(If you can't figure out why I needed to see a number, | |
+look up `weird error' in the index to The TeXbook.) | |
- ) | |
+<0> ) | |
No pages of output. | |
diff --git a/texk/web2c/eptexdir/tests/pdfprimitive-test.tex b/texk/web2c/eptexdir/tests/pdfprimitive-test.tex | |
index 150354bd6..2f7211d26 100644 | |
--- a/texk/web2c/eptexdir/tests/pdfprimitive-test.tex | |
+++ b/texk/web2c/eptexdir/tests/pdfprimitive-test.tex | |
@@ -1,6 +1,12 @@ | |
%#!euptex pdfprimitive-test.tex | |
\catcode`\{=1\catcode`\}=2 | |
\scrollmode | |
+\catcode`\Q=14 | |
+\ifdefined\pdfprimitive\else\catcode`\Q=11 \fi | |
+ | |
+Q\let\pdfprimitive\primitive\let\ifpdfprimitive\ifprimitive | |
+\catcode`\Q=11 | |
+ | |
\def\relax{\message{RELAX}} | |
\def\fuga{\message{FUGA}} | |
\let\input=\halign | |
@@ -30,4 +36,12 @@ | |
% ==> ``! Undefined control sequence.'' error | |
\setbox0=\vbox{\pdfprimitive\vrule\undefined} | |
% ==> ``! Undefined control sequence.'' error | |
+ | |
+\setbox0=\hbox{% | |
+ \def\A{\message{<\the\count42>}\ignorespaces} | |
+ \count42=\pdfprimitive\X 1\A | |
+ \count42=\pdfprimitive\- 2\A | |
+ \count42=\pdfprimitive\vrule 3\A | |
+} | |
+ | |
\end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/texk/web2c/xetexdir/xetex.ch b/texk/web2c/xetexdir/xetex.ch | |
index 0eb481a91..2f24abd3e 100644 | |
--- a/texk/web2c/xetexdir/xetex.ch | |
+++ b/texk/web2c/xetexdir/xetex.ch | |
@@ -168,9 +168,7 @@ has been detected. It has five possible values: |spotless|, |warning_issued|, | |
@x [17.222] l.4523 - frozen_special, for source specials. | |
@d frozen_null_font=frozen_control_sequence+11 | |
@y | |
-@d frozen_primitive=frozen_control_sequence+11 | |
- {permanent `\.{\\primitive}'} | |
-@d frozen_null_font=frozen_control_sequence+12 | |
+@d frozen_null_font=frozen_control_sequence+12+prim_size | |
@z | |
@x [17.230] l.4731 | |
diff --git a/texk/web2c/xetexdir/xetex.web b/texk/web2c/xetexdir/xetex.web | |
index 37e2cb3d0..aa362c74a 100644 | |
--- a/texk/web2c/xetexdir/xetex.web | |
+++ b/texk/web2c/xetexdir/xetex.web | |
@@ -5017,8 +5017,12 @@ locations for control sequences that are perpetually defined | |
@d end_write=frozen_control_sequence+8 {permanent `\.{\\endwrite}'} | |
@d frozen_dont_expand=frozen_control_sequence+9 | |
{permanent `\.{\\notexpanded:}'} | |
+@d prim_size=500 {maximum number of primitives } | |
@d frozen_null_font=frozen_control_sequence+10 | |
{permanent `\.{\\nullfont}'} | |
+@d frozen_primitive=frozen_control_sequence+11 | |
+ {permanent `\.{\\pdfprimitive}'} | |
+@d prim_eqtb_base=frozen_primitive+1 | |
@d font_id_base=frozen_null_font-font_base | |
{begins table of 257 permanent font identifiers} | |
@d undefined_control_sequence=frozen_null_font+257 {dummy location} | |
@@ -6070,7 +6074,6 @@ A global boolean variable called |no_new_control_sequence| is set to | |
@ Primitive support needs a few extra variables and definitions | |
-@d prim_size=500 {maximum number of primitives } | |
@d prim_prime=431 {about 85\pct! of |primitive_size|} | |
@d prim_base=1 | |
@d prim_next(#) == prim[#].lh {link for coalesced lists} | |
@@ -6079,24 +6082,19 @@ A global boolean variable called |no_new_control_sequence| is set to | |
@d prim_eq_level_field(#)==#.hh.b1 | |
@d prim_eq_type_field(#)==#.hh.b0 | |
@d prim_equiv_field(#)==#.hh.rh | |
-@d prim_eq_level(#)==prim_eq_level_field(prim_eqtb[#]) {level of definition} | |
-@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 prim_eq_level(#)==prim_eq_level_field(eqtb[prim_eqtb_base+#]) {level of definition} | |
+@d prim_eq_type(#)==prim_eq_type_field(eqtb[prim_eqtb_base+#]) {command code for equivalent} | |
+@d prim_equiv(#)==prim_equiv_field(eqtb[prim_eqtb_base+#]) {equivalent value} | |
@d undefined_primitive=0 | |
@<Glob...@>= | |
@!prim: array [0..prim_size] of two_halves; {the primitives table} | |
@!prim_used:pointer; {allocation pointer for |prim|} | |
-@!prim_eqtb:array[0..prim_size] of memory_word; | |
@ @<Set init...@>= | |
no_new_control_sequence:=true; {new identifiers are usually forbidden} | |
prim_next(0):=0; prim_text(0):=0; | |
for k:=1 to prim_size do prim[k]:=prim[0]; | |
-prim_eq_level(0):=level_zero; | |
-prim_eq_type(0):=undefined_cs; | |
-prim_equiv(0):=null; | |
-for k:=1 to prim_size do prim_eqtb[k]:=prim_eqtb[0]; | |
next(hash_base):=0; text(hash_base):=0; | |
for k:=hash_base+1 to undefined_control_sequence-1 do hash[k]:=hash[hash_base]; | |
@@ -6264,7 +6262,9 @@ begin if p<hash_base then {single character} | |
else if p>=undefined_control_sequence then print_esc("IMPOSSIBLE.") | |
else if (text(p)<0)or(text(p)>=str_ptr) then print_esc("NONEXISTENT.") | |
@.NONEXISTENT@> | |
-else begin print_esc(text(p)); | |
+else begin | |
+ if (p>=prim_eqtb_base)and(p<frozen_null_font) then | |
+ print_esc(prim_text(p-prim_eqtb_base)-1) else print_esc(text(p)); | |
print_char(" "); | |
end; | |
end; | |
@@ -6279,6 +6279,8 @@ begin if p<hash_base then | |
else if p<null_cs then print_esc(p-single_base) | |
else begin print_esc("csname"); print_esc("endcsname"); | |
end | |
+else if (p>=prim_eqtb_base)and(p<frozen_null_font) then | |
+ print_esc(prim_text(p-prim_eqtb_base)-1) | |
else print_esc(text(p)); | |
end; | |
@@ -8656,6 +8658,36 @@ if cur_cs<>undefined_primitive then begin | |
end; | |
end | |
+@ This block deals with unexpandable \.{\\primitive} appearing at a spot where | |
+an integer or an internal values should have been found. It fetches the | |
+next token then resets |cur_cmd|, |cur_cs|, and |cur_tok|, based on the | |
+primitive value of that token. No expansion takes place, because the | |
+next token may be all sorts of things. This could trigger further | |
+expansion creating new errors. | |
+ | |
+@<Reset |cur_tok| for unexpandable primitives, goto restart @>= | |
+begin | |
+get_token; | |
+if cur_cs < hash_base then | |
+ cur_cs := prim_lookup(cur_cs-single_base) | |
+else | |
+ cur_cs := prim_lookup(text(cur_cs)); | |
+if cur_cs<>undefined_primitive then begin | |
+ cur_cmd := prim_eq_type(cur_cs); | |
+ cur_chr := prim_equiv(cur_cs); | |
+ cur_cs := prim_eqtb_base+cur_cs; | |
+ cur_tok := cs_token_flag+cur_cs; | |
+ end | |
+else begin | |
+ cur_cmd := relax; | |
+ cur_chr := 0; | |
+ cur_tok := cs_token_flag+frozen_relax; | |
+ cur_cs := frozen_relax; | |
+ end; | |
+goto restart; | |
+end | |
+@z | |
+ | |
@ @<Complain about an undefined macro@>= | |
begin print_err("Undefined control sequence"); | |
@.Undefined control sequence@> | |
@@ -9325,14 +9357,14 @@ the internal quantity to be scanned; an error will be signalled if | |
@p procedure scan_something_internal(@!level:small_number;@!negative:boolean); | |
{fetch an internal parameter} | |
-label exit; | |
+label exit, restart; | |
var m:halfword; {|chr_code| part of the operand token} | |
n, k, kk: integer; {accumulators} | |
@!q,@!r:pointer; {general purpose indices} | |
@!tx:pointer; {effective tail node} | |
@!i:four_quarters; {character info} | |
@!p:0..nest_size; {index into |nest|} | |
-begin m:=cur_chr; | |
+begin restart: m:=cur_chr; | |
case cur_cmd of | |
def_code: @<Fetch a character code from some table@>; | |
XeTeX_def_code: | |
@@ -9376,6 +9408,8 @@ assign_font_dimen: @<Fetch a font dimension@>; | |
assign_font_int: @<Fetch a font integer@>; | |
register: @<Fetch a register@>; | |
last_item: @<Fetch an item in the current node, if appropriate@>; | |
+ignore_spaces: {trap unexpandable primitives} | |
+ if cur_chr=1 then @<Reset |cur_tok| for unexpandable primitives, goto restart@>; | |
othercases @<Complain that \.{\\the} can't do this; give zero result@> | |
endcases;@/ | |
while cur_val_level>level do @<Convert \(c)|cur_val| to a lower level@>; | |
@@ -9964,7 +9998,7 @@ after the integer part of such a fraction has been scanned by |scan_int|, | |
and that the decimal point has been backed up to be scanned again. | |
@p procedure scan_int; {sets |cur_val| to an integer} | |
-label done; | |
+label done, restart; | |
var negative:boolean; {should the answer be negated?} | |
@!m:integer; {|@t$2^{31}$@> div radix|, the threshold of danger} | |
@!d:small_number; {the digit just scanned} | |
@@ -9972,7 +10006,10 @@ var negative:boolean; {should the answer be negated?} | |
@!OK_so_far:boolean; {has an error message been issued?} | |
begin radix:=0; OK_so_far:=true;@/ | |
@<Get the next non-blank non-sign token; set |negative| appropriately@>; | |
+restart: | |
if cur_tok=alpha_token then @<Scan an alphabetic character code into |cur_val|@> | |
+else if cur_tok=cs_token_flag+frozen_primitive then | |
+ @<Reset |cur_tok| for unexpandable primitives, goto restart@> | |
else if (cur_cmd>=min_internal)and(cur_cmd<=max_internal) then | |
scan_something_internal(int_val,false) | |
else @<Scan a numeric constant@>; | |
@@ -24078,6 +24115,7 @@ any_mode(ignore_spaces): begin | |
if cur_cs<>undefined_primitive then begin | |
cur_cmd:=prim_eq_type(cur_cs); | |
cur_chr:=prim_equiv(cur_cs); | |
+ cur_tok := cs_token_flag+prim_eqtb_base+cur_cs; | |
goto reswitch; | |
end; | |
end; | |
@@ -28201,7 +28239,6 @@ for |p>=hash_used|, so the remaining entries are output in a~block. | |
@<Dump the hash table@>= | |
for p:=0 to prim_size do dump_hh(prim[p]); | |
-for p:=0 to prim_size do dump_wd(prim_eqtb[p]); | |
dump_int(hash_used); cs_count:=frozen_control_sequence-1-hash_used; | |
for p:=hash_base to hash_used do if text(p)<>0 then | |
begin dump_int(p); dump_hh(hash[p]); incr(cs_count); | |
@@ -28212,7 +28249,6 @@ print_ln; print_int(cs_count); print(" multiletter control sequences") | |
@ @<Undump the hash table@>= | |
for p:=0 to prim_size do undump_hh(prim[p]); | |
-for p:=0 to prim_size do undump_wd(prim_eqtb[p]); | |
undump(hash_base)(frozen_control_sequence)(hash_used); p:=hash_base-1; | |
repeat undump(p+1)(hash_used)(p); undump_hh(hash[p]); | |
until p=hash_used; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/texk/web2c/eptexdir/pdfutils.ch b/texk/web2c/eptexdir/pdfutils.ch | |
index ead8cdb3f..145bcdeb8 100644 | |
--- a/texk/web2c/eptexdir/pdfutils.ch | |
+++ b/texk/web2c/eptexdir/pdfutils.ch | |
@@ -555,6 +555,25 @@ for k:=j+1 to j+l-1 do | |
table, since we can use the character code itself as a direct address. | |
@z | |
+@x print_cs: \pdfprimitive | |
+else begin print_esc(text(p)); | |
+ print_char(" "); | |
+@y | |
+else begin | |
+ if (p>=prim_eqtb_base)and(p<frozen_null_font) then | |
+ print_esc(prim_text(p-prim_eqtb_base)-1) else print_esc(text(p)); | |
+ print_char(" "); | |
+@z | |
+ | |
+@x | |
+else print_esc(text(p)); | |
+@y | |
+else if (p>=prim_eqtb_base)and(p<frozen_null_font) then | |
+ print_esc(prim_text(p-prim_eqtb_base)-1) | |
+else print_esc(text(p)); | |
+@z | |
+ | |
+ | |
@x \[if]pdfprimitive | |
@p @!init procedure primitive(@!s:str_number;@!c:quarterword;@!o:halfword); | |
var k:pool_pointer; {index into |str_pool|} | |
@@ -666,12 +685,6 @@ if cur_cs<>undefined_primitive then begin | |
p:=get_avail; info(p):=cs_token_flag+frozen_primitive; | |
link(p):=loc; loc:=p; start:=p; | |
end; | |
- end | |
-else begin | |
- print_err("Missing primitive name"); | |
- help2("The control sequence marked <to be read again> does not")@/ | |
- ("represent any known primitive."); | |
- back_error; | |
end; | |
end | |
@@ -685,11 +698,15 @@ expansion creating new errors. | |
@<Reset |cur_tok| for unexpandable primitives, goto restart @>= | |
begin | |
get_token; | |
-cur_cs := prim_lookup(text(cur_cs)); | |
+if cur_cs < hash_base then | |
+ cur_cs := prim_lookup(cur_cs-single_base) | |
+else | |
+ cur_cs := prim_lookup(text(cur_cs)); | |
if cur_cs<>undefined_primitive then begin | |
cur_cmd := prim_eq_type(cur_cs); | |
cur_chr := prim_equiv(cur_cs); | |
- cur_tok := (cur_cmd*@'400)+cur_chr; | |
+ cur_cs := prim_eqtb_base+cur_cs; | |
+ cur_tok := cs_token_flag+cur_cs; | |
end | |
else begin | |
cur_cmd := relax; | |
diff --git a/texk/web2c/euptexdir/pdfstrcmp-eup-post.ch b/texk/web2c/euptexdir/pdfstrcmp-eup-post.ch | |
index 16752d25b..c09611891 100644 | |
--- a/texk/web2c/euptexdir/pdfstrcmp-eup-post.ch | |
+++ b/texk/web2c/euptexdir/pdfstrcmp-eup-post.ch | |
@@ -3,11 +3,6 @@ | |
@y | |
cur_tok := (cur_cmd*max_char_val)+cur_chr; | |
@z | |
-@x | |
- cur_tok := (cur_cmd*@'400)+cur_chr; | |
-@y | |
- cur_tok := (cur_cmd*max_char_val)+cur_chr; | |
-@z | |
@x | |
procedure print_kanji(@!s:integer); {prints a single character} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/texk/web2c/pdftexdir/pdftex.ch b/texk/web2c/pdftexdir/pdftex.ch | |
index d96bd438c..f12618ffd 100644 | |
--- a/texk/web2c/pdftexdir/pdftex.ch | |
+++ b/texk/web2c/pdftexdir/pdftex.ch | |
@@ -41,7 +41,7 @@ | |
@d frozen_null_font=frozen_control_sequence+11 | |
{permanent `\.{\\nullfont}'} | |
@y | |
-@d frozen_null_font=frozen_control_sequence+12 | |
+@d frozen_null_font=frozen_control_sequence+12+prim_size | |
{permanent `\.{\\nullfont}'} | |
@z | |
diff --git a/texk/web2c/pdftexdir/pdftex.web b/texk/web2c/pdftexdir/pdftex.web | |
index 0c741a1fb..b5918557b 100644 | |
--- a/texk/web2c/pdftexdir/pdftex.web | |
+++ b/texk/web2c/pdftexdir/pdftex.web | |
@@ -5176,10 +5176,12 @@ locations for control sequences that are perpetually defined | |
@d end_write=frozen_control_sequence+8 {permanent `\.{\\endwrite}'} | |
@d frozen_dont_expand=frozen_control_sequence+9 | |
{permanent `\.{\\notexpanded:}'} | |
+@d prim_size=2100 {maximum number of primitives } | |
@d frozen_null_font=frozen_control_sequence+10 | |
{permanent `\.{\\nullfont}'} | |
@d frozen_primitive=frozen_control_sequence+11 | |
{permanent `\.{\\pdfprimitive}'} | |
+@d prim_eqtb_base=frozen_primitive+1 | |
@d font_id_base=frozen_null_font-font_base | |
{begins table of 257 permanent font identifiers} | |
@d undefined_control_sequence=frozen_null_font+257 {dummy location} | |
@@ -6455,7 +6457,6 @@ A global boolean variable called |no_new_control_sequence| is set to | |
@ Primitive support needs a few extra variables and definitions | |
-@d prim_size=2100 {maximum number of primitives } | |
@d prim_prime=1777 {about 85\pct! of |primitive_size|} | |
@d prim_base=1 | |
@d prim_next(#) == prim[#].lh {link for coalesced lists} | |
@@ -6464,25 +6465,20 @@ A global boolean variable called |no_new_control_sequence| is set to | |
@d prim_eq_level_field(#)==#.hh.b1 | |
@d prim_eq_type_field(#)==#.hh.b0 | |
@d prim_equiv_field(#)==#.hh.rh | |
-@d prim_eq_level(#)==prim_eq_level_field(prim_eqtb[#]) {level of definition} | |
-@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 prim_eq_level(#)==prim_eq_level_field(eqtb[prim_eqtb_base+#]) {level of definition} | |
+@d prim_eq_type(#)==prim_eq_type_field(eqtb[prim_eqtb_base+#]) {command code for equivalent} | |
+@d prim_equiv(#)==prim_equiv_field(eqtb[prim_eqtb_base+#]) {equivalent value} | |
@d undefined_primitive=0 | |
@d biggest_char=255 { 65535 in XeTeX } | |
@<Glob...@>= | |
@!prim: array [0..prim_size] of two_halves; {the primitives table} | |
@!prim_used:pointer; {allocation pointer for |prim|} | |
-@!prim_eqtb:array[0..prim_size] of memory_word; | |
@ @<Set init...@>= | |
no_new_control_sequence:=true; {new identifiers are usually forbidden} | |
prim_next(0):=0; prim_text(0):=0; | |
for k:=1 to prim_size do prim[k]:=prim[0]; | |
-prim_eq_level(0) := level_zero; | |
-prim_eq_type(0) := undefined_cs; | |
-prim_equiv(0) := null; | |
-for k:=1 to prim_size do prim_eqtb[k]:=prim_eqtb[0]; | |
next(hash_base):=0; text(hash_base):=0; | |
for k:=hash_base+1 to undefined_control_sequence-1 do hash[k]:=hash[hash_base]; | |
@@ -6642,7 +6638,9 @@ begin if p<hash_base then {single character} | |
else if p>=undefined_control_sequence then print_esc("IMPOSSIBLE.") | |
else if (text(p)<0)or(text(p)>=str_ptr) then print_esc("NONEXISTENT.") | |
@.NONEXISTENT@> | |
-else begin print_esc(text(p)); | |
+else begin | |
+ if (p>=prim_eqtb_base)and(p<frozen_null_font) then | |
+ print_esc(prim_text(p-prim_eqtb_base)-1) else print_esc(text(p)); | |
print_char(" "); | |
end; | |
end; | |
@@ -6657,6 +6655,8 @@ begin if p<hash_base then | |
else if p<null_cs then print_esc(p-single_base) | |
else begin print_esc("csname"); print_esc("endcsname"); | |
end | |
+else if (p>=prim_eqtb_base)and(p<frozen_null_font) then | |
+ print_esc(prim_text(p-prim_eqtb_base)-1) | |
else print_esc(text(p)); | |
end; | |
@@ -8939,12 +8939,6 @@ if cur_cs<>undefined_primitive then begin | |
p:=get_avail; info(p):=cs_token_flag+frozen_primitive; | |
link(p):=loc; loc:=p; start:=p; | |
end; | |
- end | |
-else begin | |
- print_err("Missing primitive name"); | |
- help2("The control sequence marked <to be read again> does not")@/ | |
- ("represent any known primitive."); | |
- back_error; | |
end; | |
end | |
@@ -8958,11 +8952,15 @@ expansion creating new errors. | |
@<Reset |cur_tok| for unexpandable primitives, goto restart @>= | |
begin | |
get_token; | |
-cur_cs := prim_lookup(text(cur_cs)); | |
+if cur_cs < hash_base then | |
+ cur_cs := prim_lookup(cur_cs-single_base) | |
+else | |
+ cur_cs := prim_lookup(text(cur_cs)); | |
if cur_cs<>undefined_primitive then begin | |
cur_cmd := prim_eq_type(cur_cs); | |
cur_chr := prim_equiv(cur_cs); | |
- cur_tok := (cur_cmd*@'400)+cur_chr; | |
+ cur_cs := prim_eqtb_base+cur_cs; | |
+ cur_tok := cs_token_flag+cur_cs; | |
end | |
else begin | |
cur_cmd := relax; | |
@@ -28807,6 +28805,7 @@ any_mode(ignore_spaces): begin | |
if cur_cs<>undefined_primitive then begin | |
cur_cmd := prim_eq_type(cur_cs); | |
cur_chr := prim_equiv(cur_cs); | |
+ cur_tok := cs_token_flag+prim_eqtb_base+cur_cs; | |
goto reswitch; | |
end; | |
end; | |
@@ -32706,7 +32705,6 @@ for |p>=hash_used|, so the remaining entries are output in a~block. | |
@<Dump the hash table@>= | |
for p:=0 to prim_size do dump_hh(prim[p]); | |
-for p:=0 to prim_size do dump_wd(prim_eqtb[p]); | |
dump_int(hash_used); cs_count:=frozen_control_sequence-1-hash_used; | |
for p:=hash_base to hash_used do if text(p)<>0 then | |
begin dump_int(p); dump_hh(hash[p]); incr(cs_count); | |
@@ -32717,7 +32715,6 @@ print_ln; print_int(cs_count); print(" multiletter control sequences") | |
@ @<Undump the hash table@>= | |
for p:=0 to prim_size do undump_hh(prim[p]); | |
-for p:=0 to prim_size do undump_wd(prim_eqtb[p]); | |
undump(hash_base)(frozen_control_sequence)(hash_used); p:=hash_base-1; | |
repeat undump(p+1)(hash_used)(p); undump_hh(hash[p]); | |
until p=hash_used; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/texk/web2c/xetexdir/xetex.web b/texk/web2c/xetexdir/xetex.web | |
index aa362c74a..82a4e3249 100644 | |
--- a/texk/web2c/xetexdir/xetex.web | |
+++ b/texk/web2c/xetexdir/xetex.web | |
@@ -8655,6 +8655,12 @@ if cur_cs<>undefined_primitive then begin | |
p:=get_avail; info(p):=cs_token_flag+frozen_primitive; | |
link(p):=loc; loc:=p; start:=p; | |
end; | |
+ end | |
+else begin | |
+ print_err("Missing primitive name"); | |
+ help2("The control sequence marked <to be read again> does not")@/ | |
+ ("represent any known primitive."); | |
+ back_error; | |
end; | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment