summaryrefslogtreecommitdiff
path: root/Build/source
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
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')
-rw-r--r--Build/source/texk/web2c/ptexdir/ChangeLog4
-rw-r--r--Build/source/texk/web2c/ptexdir/ptex-base.ch44
2 files changed, 47 insertions, 1 deletions
diff --git a/Build/source/texk/web2c/ptexdir/ChangeLog b/Build/source/texk/web2c/ptexdir/ChangeLog
index 540b61801a2..ba8d0f9432b 100644
--- a/Build/source/texk/web2c/ptexdir/ChangeLog
+++ b/Build/source/texk/web2c/ptexdir/ChangeLog
@@ -1,3 +1,7 @@
+2017-10-04 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
+
+ * ptex-base.ch: Direction check in \discretionary.
+
2017-09-11 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
* ptex-base.ch: Assigning the default value frees the KINSOKU table
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