Skip to content

Commit

Permalink
ptex-base.ch: exception for infinite penalty (more)
Browse files Browse the repository at this point in the history
  • Loading branch information
aminophen committed Sep 12, 2017
1 parent 257ea02 commit 683c728
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions source/texk/web2c/ptexdir/ptex-base.ch
Original file line number Diff line number Diff line change
Expand Up @@ -6409,13 +6409,14 @@ begin kp:=get_kinsoku_pos(cx,cur_pos);
if kp<>no_entry then if kinsoku_penalty(kp)<>0 then
begin if kinsoku_type(kp)=pre_break_penalty_code then
begin if not is_char_node(cur_q)and(type(cur_q)=penalty_node) then
if (penalty(cur_q)>-10000)and(penalty(cur_q)<10000) then
begin if (penalty(cur_q)>-10000)and(penalty(cur_q)<10000) then
if (kinsoku_penalty(kp)>=10000) then penalty(cur_q):=10000
else if (kinsoku_penalty(kp)<=-10000) then penalty(cur_q):=-10000
else begin penalty(cur_q):=penalty(cur_q)+kinsoku_penalty(kp);
if (penalty(cur_q)>=10000) then penalty(cur_q):=10000
else if (penalty(cur_q)<=-10000) then penalty(cur_q):=-10000;
end
end
else
begin main_p:=link(cur_q); link(cur_q):=new_penalty(kinsoku_penalty(kp));
subtype(link(cur_q)):=kinsoku_pena; link(link(cur_q)):=main_p;
Expand All @@ -6433,7 +6434,14 @@ begin kp:=get_kinsoku_pos(cur_chr,cur_pos);
if kp<>no_entry then if kinsoku_penalty(kp)<>0 then
begin if kinsoku_type(kp)=pre_break_penalty_code then
if not is_char_node(tail)and(type(tail)=penalty_node) then
penalty(tail):=penalty(tail)+kinsoku_penalty(kp)
begin if (penalty(tail)>-10000)and(penalty(tail)<10000) then
if (kinsoku_penalty(kp)>=10000) then penalty(tail):=10000
else if (kinsoku_penalty(kp)<=-10000) then penalty(tail):=-10000
else begin penalty(tail):=penalty(tail)+kinsoku_penalty(kp);
if (penalty(tail)>=10000) then penalty(tail):=10000
else if (penalty(tail)<=-10000) then penalty(tail):=-10000;
end
end
else
begin tail_append(new_penalty(kinsoku_penalty(kp)));
subtype(tail):=kinsoku_pena;
Expand Down

0 comments on commit 683c728

Please sign in to comment.