diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-03-31 22:49:18 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-03-31 22:49:18 +0000 |
commit | 4f0696d9aa8cf04c1e0106e830e28c45556588ce (patch) | |
tree | 50b4903b9c5e10d14e73bca7f2b1838f8a74b6d1 /Build/source/texk/web2c/luatexdir/tex/buildpage.w | |
parent | 657b5cfe19672cc27026ed2ab78b667062af6e68 (diff) |
web2c/luatexdir: sync with the upstream
git-svn-id: svn://tug.org/texlive/trunk@40200 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/tex/buildpage.w')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/tex/buildpage.w | 63 |
1 files changed, 27 insertions, 36 deletions
diff --git a/Build/source/texk/web2c/luatexdir/tex/buildpage.w b/Build/source/texk/web2c/luatexdir/tex/buildpage.w index 4c61a510a9c..104566f790b 100644 --- a/Build/source/texk/web2c/luatexdir/tex/buildpage.w +++ b/Build/source/texk/web2c/luatexdir/tex/buildpage.w @@ -316,15 +316,14 @@ void build_page(void) p = vlink(contrib_head); /* Update the values of |last_glue|, |last_penalty|, and |last_kern| */ if (last_glue != max_halfword) { - delete_glue_ref(last_glue); + flush_node(last_glue); last_glue = max_halfword; } last_penalty = 0; last_kern = 0; last_node_type = type(p) + 1; if (type(p) == glue_node) { - last_glue = glue_ptr(p); - add_glue_ref(last_glue); + last_glue = new_glue(p); } else if (type(p) == penalty_node) { last_penalty = penalty(p); } else if (type(p) == kern_node) { @@ -360,17 +359,17 @@ void build_page(void) freeze_page_specs(box_there); else page_contents = box_there; - q = new_skip_param(top_skip_code); /* now |temp_ptr=glue_ptr(q)| */ + q = new_skip_param(top_skip_code); if ((type(p) == hlist_node) && is_mirrored(body_direction)) { - if (width(temp_ptr) > depth(p)) - width(temp_ptr) = width(temp_ptr) - depth(p); + if (width(q) > depth(p)) + width(q) = width(q) - depth(p); else - width(temp_ptr) = 0; + width(q) = 0; } else { - if (width(temp_ptr) > height(p)) - width(temp_ptr) = width(temp_ptr) - height(p); + if (width(q) > height(p)) + width(q) = width(q) - height(p); else - width(temp_ptr) = 0; + width(q) = 0; } couple_nodes(q, p); couple_nodes(contrib_head, q); @@ -633,32 +632,24 @@ void build_page(void) /* Update the current page measurements with respect to the glue or kern specified by node~|p| */ - if (type(p) == kern_node) { - q = p; - } else { - q = glue_ptr(p); - if (stretch_order(q) > 1) - page_so_far[1 + stretch_order(q)] = - page_so_far[1 + stretch_order(q)] + stretch(q); + if (type(p) != kern_node) { + if (stretch_order(p) > 1) + page_so_far[1 + stretch_order(p)] = page_so_far[1 + stretch_order(p)] + stretch(p); else - page_so_far[2 + stretch_order(q)] = - page_so_far[2 + stretch_order(q)] + stretch(q); - page_shrink = page_shrink + shrink(q); - if ((shrink_order(q) != normal) && (shrink(q) != 0)) { + page_so_far[2 + stretch_order(p)] = page_so_far[2 + stretch_order(p)] + stretch(p); + page_shrink = page_shrink + shrink(p); + if ((shrink_order(p) != normal) && (shrink(p) != 0)) { print_err("Infinite glue shrinkage found on current page"); help4("The page about to be output contains some infinitely", "shrinkable glue, e.g., `\\vss' or `\\vskip 0pt minus 1fil'.", "Such glue doesn't belong there; but you can safely proceed,", "since the offensive shrinkability has been made finite."); error(); - r = new_spec(q); - shrink_order(r) = normal; - delete_glue_ref(q); - glue_ptr(p) = r; - q = r; + reset_glue_to_zero(p); + shrink_order(p) = normal; } } - page_total = page_total + page_depth + width(q); + page_total = page_total + page_depth + width(p); page_depth = 0; CONTRIBUTE: /* go here to link a node into the current page */ @@ -814,6 +805,7 @@ void fire_up(halfword c) s = last_ins_ptr(r); vlink(s) = ins_ptr(p); if (best_ins_ptr(r) == p) { + halfword t; /* was a global temp_ptr */ /* Wrap up the box specified by node |r|, splitting node |p| if called for; set |wait:=true| if node |p| holds a remainder after splitting */ @@ -826,22 +818,20 @@ void fire_up(halfword c) ins_ptr(p) = prune_page_top(broken_ptr(r), false); if (ins_ptr(p) != null) { - temp_ptr = - vpack(ins_ptr(p), 0, additional, -1); - height(p) = - height(temp_ptr) + depth(temp_ptr); - list_ptr(temp_ptr) = null; - flush_node(temp_ptr); + t = vpack(ins_ptr(p), 0, additional, -1); + height(p) = height(t) + depth(t); + list_ptr(t) = null; + flush_node(t); wait = true; } } } best_ins_ptr(r) = null; n = subtype(r); - temp_ptr = list_ptr(box(n)); + t = list_ptr(box(n)); list_ptr(box(n)) = null; flush_node(box(n)); - box(n) = vpack(temp_ptr, 0, additional, body_direction); + box(n) = vpack(t, 0, additional, body_direction); } else { while (vlink(s) != null) @@ -910,7 +900,7 @@ void fire_up(halfword c) vbadness = save_vbadness; vfuzz = save_vfuzz; if (last_glue != max_halfword) - delete_glue_ref(last_glue); + flush_node(last_glue); /* Start a new current page */ start_new_page(); /* this sets |last_glue:=max_halfword| */ if (q != hold_head) { @@ -921,6 +911,7 @@ void fire_up(halfword c) /* Delete the page-insertion nodes */ r = vlink(page_ins_head); while (r != page_ins_head) { + /* todo: couple */ q = vlink(r); flush_node(r); r = q; |