summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/ptexdir/ptex-base.ch
diff options
context:
space:
mode:
authorHironobu Yamashita <h.y.acetaminophen@gmail.com>2017-10-04 12:57:17 +0000
committerHironobu Yamashita <h.y.acetaminophen@gmail.com>2017-10-04 12:57:17 +0000
commitb3a6a312f02486563f90e24dbb7555d63d54c31a (patch)
treee9f52681548cef617b0ec46923b5fef459c8f3b0 /Build/source/texk/web2c/ptexdir/ptex-base.ch
parenta9fc2366b811ec4800f643f949dcd6c351ecf489 (diff)
ptex-base.ch: direction check in \discretionary (H. Kitagawa)
git-svn-id: svn://tug.org/texlive/trunk@45463 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/ptexdir/ptex-base.ch')
-rw-r--r--Build/source/texk/web2c/ptexdir/ptex-base.ch44
1 files changed, 43 insertions, 1 deletions
diff --git a/Build/source/texk/web2c/ptexdir/ptex-base.ch b/Build/source/texk/web2c/ptexdir/ptex-base.ch
index 57ef1bc3d6a..1600827d507 100644
--- a/Build/source/texk/web2c/ptexdir/ptex-base.ch
+++ b/Build/source/texk/web2c/ptexdir/ptex-base.ch
@@ -5132,7 +5132,7 @@ insert_group: begin end_graf; q:=split_top_skip; add_glue_ref(q);
end
else begin
if abs(box_dir(p))<>abs(adjust_dir) then
- begin print_err("Direction Incompatible.");
+ begin print_err("Direction Incompatible");
help1("\vadjust's argument and outer vlist must have same direction.");
error; flush_node_list(list_ptr(p));
end
@@ -5326,6 +5326,48 @@ begin if tail<>head then
end;
@z
+@x pTeX: direction check in \discretionary
+@!n:integer; {length of discretionary list}
+@y
+@!n:integer; {length of discretionary list}
+@!d:integer; {direction}
+@z
+
+@x pTeX: direction check in \discretionary
+p:=link(head); pop_nest;
+case saved(-1) of
+0:pre_break(tail):=p;
+1:post_break(tail):=p;
+@y
+p:=link(head); d:=abs(direction); pop_nest;
+case saved(-1) of
+0:if abs(direction)=d then pre_break(tail):=p
+ else begin
+ print_err("Direction Incompatible");
+ help2("\discretionary's argument and outer hlist must have same direction.")@/
+ ("I delete your first part."); error; pre_break(tail):=null; flush_node_list(p);
+ end;
+1:if abs(direction)=d then post_break(tail):=p
+ else begin
+ print_err("Direction Incompatible");
+ help2("\discretionary's argument and outer hlist must have same direction.")@/
+ ("I delete your second part."); error; post_break(tail):=null; flush_node_list(p);
+ end;
+@z
+
+@x pTeX: direction check in \discretionary
+else link(tail):=p;
+if n<=max_quarterword then replace_count(tail):=n
+@y
+else if (n>0)and(abs(direction)<>d) then
+ begin print_err("Direction Incompatible");
+ help2("\discretionary's argument and outer hlist must have same direction.")@/
+ ("I delete your third part."); flush_node_list(p); n:=0; error;
+ end
+else link(tail):=p;
+if n<=max_quarterword then replace_count(tail):=n
+@z
+
@x [47.1120] l.22119 - pTeX: discretionary with disp_node
decr(save_ptr); return;
@y