summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/xetexdir
diff options
context:
space:
mode:
authorHan The Thanh <hanthethanh@gmail.com>2010-12-20 02:29:38 +0000
committerHan The Thanh <hanthethanh@gmail.com>2010-12-20 02:29:38 +0000
commitb146564f520f59f90a2d2b1eb14a50be92ff3822 (patch)
treede769151c5778d6f4308bb8c5ad5df309653f077 /Build/source/texk/web2c/xetexdir
parenta2a8ead9a0a3137914be1c71c012f1b44eb6957a (diff)
backported bugfixes from pdftex: nesting ifincsname & pre vadust
git-svn-id: svn://tug.org/texlive/trunk@20809 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/xetexdir')
-rw-r--r--Build/source/texk/web2c/xetexdir/xetex-latex3.ch75
1 files changed, 64 insertions, 11 deletions
diff --git a/Build/source/texk/web2c/xetexdir/xetex-latex3.ch b/Build/source/texk/web2c/xetexdir/xetex-latex3.ch
index ee12e225ee1..95227ac8eb1 100644
--- a/Build/source/texk/web2c/xetexdir/xetex-latex3.ch
+++ b/Build/source/texk/web2c/xetexdir/xetex-latex3.ch
@@ -37,7 +37,7 @@ authorization from the copyright holders.
@d adjust_node=5 {|type| of an adjust node}
@y
@d adjust_node=5 {|type| of an adjust node}
-@d adjust_pre == subtype {pre-adjustment?}
+@d adjust_pre == subtype {<>0 => pre-adjustment}
@#{|append_list| is used to append a list to |tail|}
@d append_list(#) == begin link(tail) := link(#); append_list_end
@d append_list_end(#) == tail := #; end
@@ -272,6 +272,14 @@ no_expand: if chr_code=0 then print_esc("noexpand")
@z
% \ifincsname
+@x
+var t:halfword; {token that is being ``expanded after''}
+@y
+var t:halfword; {token that is being ``expanded after''}
+@!b:boolean; {keep track of nested csnames}
+@z
+
+% \ifincsname
@x l.8348
@ @<Expand a nonmacro@>=
@y
@@ -337,18 +345,19 @@ end
@z
% \ifincsname
-@x l.8415
-repeat get_x_token;
-if cur_cs=0 then store_new_token(cur_tok);
-until cur_cs<>0;
+@x
+begin r:=get_avail; p:=r; {head of the list of characters}
+@y
+begin r:=get_avail; p:=r; {head of the list of characters}
+b := is_in_csname; is_in_csname := true;
+@z
+
+% \ifincsname
+@x
if (cur_cmd<>end_cs_name) or (cur_chr<>0) then @<Complain about missing \.{\\endcsname}@>;
@y
-is_in_csname := true;
-repeat get_x_token;
-if cur_cs=0 then store_new_token(cur_tok);
-until cur_cs<>0;
if (cur_cmd<>end_cs_name) or (cur_chr<>0) then @<Complain about missing \.{\\endcsname}@>;
-is_in_csname := false;
+is_in_csname := b;
@z
% \strcmp
@@ -446,6 +455,14 @@ primitive("ifprimitive",if_test,if_primitive_code);
if_primitive_code:print_esc("ifprimitive");
@z
+% \ifincsname
+@x
+var b:boolean; {is the condition true?}
+@y
+var b:boolean; {is the condition true?}
+@!e:boolean; {keep track of nested csnames}
+@z
+
% \ifprimitive
@x l.10723
if_case_code: @<Select the appropriate case
@@ -478,6 +495,14 @@ if pre_adjust_tail<>null then link(pre_adjust_tail):=null;
@z
% \vadjust
+@x
+ ins_node,mark_node,adjust_node: if adjust_tail<>null then
+@y
+ ins_node,mark_node,adjust_node: if (adjust_tail<>null) or (pre_adjust_tail<> null) then
+@z
+
+
+% \vadjust
@x l.14607
@<Transfer node |p| to the adjustment list@>=
begin while link(q)<>p do q:=link(q);
@@ -501,6 +526,8 @@ pre_adjust_tail := null;
|pre_adjust_tail| instead of |adjust_tail|.
@d update_adjust_list(#) == begin
+ if # = null then
+ confusion("pre vadjust");
link(#) := adjust_ptr(p);
while link(#) <> null do
# := link(#);
@@ -547,17 +574,27 @@ cur_pre_head:=null; cur_pre_tail:=null;
% \vadjust
@x l.17607
info(p+4):=cur_head; link(p+4):=cur_tail;
+align_ptr:=p;
+cur_head:=get_avail;
@y
info(p+4):=cur_head; link(p+4):=cur_tail;
info(p+5):=cur_pre_head; link(p+5):=cur_pre_tail;
+align_ptr:=p;
+cur_head:=get_avail;
+cur_pre_head:=get_avail;
@z
% \vadjust
@x l.17616
+begin free_avail(cur_head);
+p:=align_ptr;
cur_tail:=link(p+4); cur_head:=info(p+4);
@y
-cur_pre_tail:=link(p+5); cur_pre_head:=info(p+5);
+begin free_avail(cur_head);
+free_avail(cur_pre_head);
+p:=align_ptr;
cur_tail:=link(p+4); cur_head:=info(p+4);
+cur_pre_tail:=link(p+5); cur_pre_head:=info(p+5);
@z
% \vadjust
@@ -887,6 +924,22 @@ if_in_csname_code:print_esc("ifincsname");
@z
% \ifincsname
+@x
+if_cs_code:begin n:=get_avail; p:=n; {head of the list of characters}
+@y
+if_cs_code:begin n:=get_avail; p:=n; {head of the list of characters}
+ e := is_in_csname; is_in_csname := true;
+@z
+
+% \ifincsname
+@x
+ b:=(eq_type(cur_cs)<>undefined_cs);
+@y
+ b:=(eq_type(cur_cs)<>undefined_cs);
+ is_in_csname := e;
+@z
+
+% \ifincsname
@x l.31189
if_font_char_code:begin scan_font_ident; n:=cur_val; scan_usv_num;
@y