summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/tex
diff options
context:
space:
mode:
authorTaco Hoekwater <taco@elvenkind.com>2011-04-12 14:17:47 +0000
committerTaco Hoekwater <taco@elvenkind.com>2011-04-12 14:17:47 +0000
commit307453997ef030ec4dfa1e876feaf0b8b8125bab (patch)
treeab2054693ba95e9ac8f6e3478b4d0175d893329f /Build/source/texk/web2c/luatexdir/tex
parentd95b11a25d3d9e17cc4afb9c8713ef4037567527 (diff)
check in luatex 0.66.0
git-svn-id: svn://tug.org/texlive/trunk@22059 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/tex')
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/align.w16
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/arithmetic.h6
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/arithmetic.w2
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/buildpage.w42
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/commands.h17
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/commands.w30
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/conditional.w6
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/directions.h30
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/directions.w2
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/dumpdata.h8
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/dumpdata.w19
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/equivalents.h21
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/equivalents.w6
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/errors.w2
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/expand.w6
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/extensions.w8
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/filename.w6
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/inputstack.h8
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/inputstack.w15
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/linebreak.h6
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/linebreak.w27
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/mainbody.h18
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/mainbody.w14
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/maincontrol.h3
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/maincontrol.w1460
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/mathcodes.w19
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/memoryword.w2
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/mlist.w91
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/nesting.w4
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/packaging.h12
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/packaging.w12
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/postlinebreak.w32
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/primitive.w18
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/printing.w24
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/scanning.h4
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/scanning.w5
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/stringpool.h3
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/stringpool.w2
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texdeffont.w2
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texfileio.h4
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texfileio.w247
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texmath.w90
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texnodes.h18
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texnodes.w65
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/textcodes.w4
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/textoken.h6
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/textoken.w72
47 files changed, 1216 insertions, 1298 deletions
diff --git a/Build/source/texk/web2c/luatexdir/tex/align.w b/Build/source/texk/web2c/luatexdir/tex/align.w
index 8e21f7ed86a..827e2bc07ae 100644
--- a/Build/source/texk/web2c/luatexdir/tex/align.w
+++ b/Build/source/texk/web2c/luatexdir/tex/align.w
@@ -23,8 +23,8 @@
#include "ptexlib.h"
static const char _svn_version[] =
- "$Id: align.w 3612 2010-04-13 09:29:42Z taco $ "
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/align.w $";
+ "$Id: align.w 4044 2010-12-18 09:23:06Z taco $ "
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/align.w $";
@ @c
void fin_align(void);
@@ -239,12 +239,14 @@ static void push_alignment(void)
vlink(p + 5) = cur_pre_tail;
align_ptr = p;
cur_head = new_node(temp_node, 0);
+ cur_pre_head = new_node(temp_node, 0);
}
static void pop_alignment(void)
{
pointer p; /* the top alignment stack node */
flush_node(cur_head);
+ flush_node(cur_pre_head);
p = align_ptr;
cur_pre_tail = vlink(p + 5);
cur_pre_head = vinfo(p + 5);
@@ -953,11 +955,11 @@ value is changed to zero and so is the next tabskip.
if (cur_list.mode_field == -vmode) {
type(q) = hlist_node;
- subtype(q) = 0;
+ subtype(q) = HLIST_SUBTYPE_ALIGNROW;
width(q) = width(p);
} else {
type(q) = vlist_node;
- subtype(q) = 0;
+ subtype(q) = HLIST_SUBTYPE_ALIGNROW;
height(q) = height(p);
}
glue_order(q) = glue_order(p);
@@ -1004,6 +1006,7 @@ value is changed to zero and so is the next tabskip.
vlink(u) = rr;
u = vlink(u);
t = t + width(s);
+ subtype(u) = HLIST_SUBTYPE_ALIGNCELL;
if (cur_list.mode_field == -vmode) {
width(u) = width(s);
} else {
@@ -1045,6 +1048,7 @@ value is changed to zero and so is the next tabskip.
}
width(r) = w;
type(r) = hlist_node;
+ subtype(r) = HLIST_SUBTYPE_ALIGNCELL;
} else {
/* Make the unset node |r| into a |vlist_node| of height |w|,
@@ -1076,9 +1080,10 @@ value is changed to zero and so is the next tabskip.
}
height(r) = w;
type(r) = vlist_node;
+ subtype(r) = HLIST_SUBTYPE_ALIGNCELL;
}
- subtype(r) = 0;
+ /* subtype(r) = 0; */
shift_amount(r) = 0;
if (u != hold_head) { /* append blank boxes to account for spanned nodes */
vlink(u) = vlink(r);
@@ -1104,6 +1109,7 @@ value is changed to zero and so is the next tabskip.
vlink(q) = null;
q = hpack(q, 0, additional, -1);
shift_amount(q) = o;
+ subtype(q) = HLIST_SUBTYPE_ALIGNCELL;
vlink(q) = r;
vlink(s) = q;
}
diff --git a/Build/source/texk/web2c/luatexdir/tex/arithmetic.h b/Build/source/texk/web2c/luatexdir/tex/arithmetic.h
index 89dce4e4f74..6e809372ab6 100644
--- a/Build/source/texk/web2c/luatexdir/tex/arithmetic.h
+++ b/Build/source/texk/web2c/luatexdir/tex/arithmetic.h
@@ -17,15 +17,15 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: arithmetic.h 3477 2010-03-12 13:59:34Z taco $ */
+/* $Id: arithmetic.h 3853 2010-09-03 18:05:14Z oneiros $ */
#ifndef ARITHMETIC_H
# define ARITHMETIC_H
/* |incr| and |decr| are in texmfmp.h */
- /* #define incr(A) (A)++ *//* increase a variable by unity */
- /* #define decr(A) (A)-- *//* decrease a variable by unity */
+ /* #define incr(A) (A)++ *//* increase a variable by unity */
+ /* #define decr(A) (A)-- *//* decrease a variable by unity */
# define negate(A) (A)=-(A) /* change the sign of a variable */
diff --git a/Build/source/texk/web2c/luatexdir/tex/arithmetic.w b/Build/source/texk/web2c/luatexdir/tex/arithmetic.w
index 76ccbbf419e..f0f0adb5abd 100644
--- a/Build/source/texk/web2c/luatexdir/tex/arithmetic.w
+++ b/Build/source/texk/web2c/luatexdir/tex/arithmetic.w
@@ -24,7 +24,7 @@
static const char _svn_version[] =
"$Id: arithmetic.w 3587 2010-04-03 14:32:25Z taco $"
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/arithmetic.w $";
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/arithmetic.w $";
@ The principal computations performed by \TeX\ are done entirely in terms of
diff --git a/Build/source/texk/web2c/luatexdir/tex/buildpage.w b/Build/source/texk/web2c/luatexdir/tex/buildpage.w
index 2c2c8460464..bc6f61a15dc 100644
--- a/Build/source/texk/web2c/luatexdir/tex/buildpage.w
+++ b/Build/source/texk/web2c/luatexdir/tex/buildpage.w
@@ -19,8 +19,8 @@
@ @c
static const char _svn_version[] =
- "$Id: buildpage.w 3587 2010-04-03 14:32:25Z taco $"
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/buildpage.w $";
+ "$Id: buildpage.w 4132 2011-04-11 14:04:10Z taco $"
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/buildpage.w $";
#include "ptexlib.h"
@@ -387,8 +387,8 @@ void build_page(void)
else
width(temp_ptr) = 0;
}
- vlink(q) = p;
- vlink(contrib_head) = q;
+ couple_nodes(q, p);
+ couple_nodes(contrib_head, q);
goto CONTINUE;
} else {
@@ -462,8 +462,8 @@ void build_page(void)
or extremely lucky, or both. */
q = new_node(inserting_node, n);
- vlink(q) = vlink(r);
- vlink(r) = q;
+ try_couple_nodes(q, vlink(r));
+ couple_nodes(r, q);
r = q;
ensure_vbox(n);
if (box(n) == null)
@@ -569,6 +569,7 @@ void build_page(void)
break;
default:
+ fprintf(stderr, "type(p)=%d\n", type(p));
confusion("page");
break;
}
@@ -691,20 +692,21 @@ void build_page(void)
}
/* Link node |p| into the current page and |goto done| */
- vlink(page_tail) = p;
+ couple_nodes(page_tail, p);
page_tail = p;
- vlink(contrib_head) = vlink(p);
+ try_couple_nodes(contrib_head,vlink(p));
vlink(p) = null;
goto DONE;
DONE1:
/* Recycle node |p| */
- vlink(contrib_head) = vlink(p);
+ try_couple_nodes(contrib_head,vlink(p));
vlink(p) = null;
if (int_par(saving_vdiscards_code) > 0) {
- if (page_disc == null)
+ if (page_disc == null) {
page_disc = p;
- else
- vlink(tail_page_disc) = p;
+ } else {
+ couple_nodes(tail_page_disc, p);
+ }
tail_page_disc = p;
} else {
flush_node_list(p);
@@ -871,10 +873,10 @@ void fire_up(halfword c)
}
/* Either append the insertion node |p| after node |q|, and remove it
from the current page, or delete |node(p)| */
- vlink(prev_p) = vlink(p);
+ try_couple_nodes(prev_p, vlink(p));
vlink(p) = null;
if (wait) {
- vlink(q) = p;
+ couple_nodes(q, p);
q = p;
incr(insert_penalties);
} else {
@@ -917,8 +919,8 @@ void fire_up(halfword c)
if (vlink(contrib_head) == null) {
contrib_tail = page_tail;
}
- vlink(page_tail) = vlink(contrib_head);
- vlink(contrib_head) = p;
+ couple_nodes(page_tail,vlink(contrib_head));
+ couple_nodes(contrib_head, p);
vlink(prev_p) = null;
}
save_vbadness = vbadness;
@@ -997,7 +999,7 @@ void fire_up(halfword c)
}
flush_node_list(page_disc);
page_disc = null;
- ship_out(static_pdf, box(output_box), true);
+ ship_out(static_pdf, box(output_box), SHIPPING_PAGE);
box(output_box) = null;
}
@@ -1037,14 +1039,14 @@ void resume_after_output(void)
}
if (tail != head) { /* current list goes after heldover insertions */
- vlink(page_tail) = vlink(head);
+ try_couple_nodes(page_tail, vlink(head));
page_tail = tail;
}
if (vlink(page_head) != null) { /* and both go before heldover contributions */
if (vlink(contrib_head) == null)
contrib_tail = page_tail;
- vlink(page_tail) = vlink(contrib_head);
- vlink(contrib_head) = vlink(page_head);
+ try_couple_nodes(page_tail, vlink(contrib_head));
+ try_couple_nodes(contrib_head, vlink(page_head));
vlink(page_head) = null;
page_tail = page_head;
}
diff --git a/Build/source/texk/web2c/luatexdir/tex/commands.h b/Build/source/texk/web2c/luatexdir/tex/commands.h
index 88d012aaa5c..6c8ceec4570 100644
--- a/Build/source/texk/web2c/luatexdir/tex/commands.h
+++ b/Build/source/texk/web2c/luatexdir/tex/commands.h
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: commands.h 2899 2009-07-21 23:03:53Z oneiros $ */
+/* $Id: commands.h 4000 2010-11-28 13:58:35Z taco $ */
#ifndef COMMANDS_H
# define COMMANDS_H
@@ -143,14 +143,14 @@ typedef enum {
super_sub_script_cmd, /* explicit super- or subscript */
math_shift_cs_cmd, /* start- and endmath */
end_cs_name_cmd, /* end control sequence ( \.{\\endcsname} ) */
- char_ghost_cmd, /* \.{\\ghostleft}, \.{\\ghostright} character for kerning */
+ char_ghost_cmd, /* \.{\\leftghost}, \.{\\rightghost} character for kerning */
assign_local_box_cmd, /* box for guillemets \.{\\localleftbox} or \.{\\localrightbox} */
char_given_cmd, /* character code defined by \.{\\chardef} */
# define min_internal_cmd char_given_cmd
/* the smallest code that can follow \.{\\the} */
math_given_cmd, /* math code defined by \.{\\mathchardef} */
omath_given_cmd, /* math code defined by \.{\\omathchardef} */
- xmath_given_cmd, /* math code defined by \.{\\LuaTeXmathchardef} */
+ xmath_given_cmd, /* math code defined by \.{\\Umathchardef} */
last_item_cmd, /* most recent item ( \.{\\lastpenalty}, \.{\\lastkern}, \.{\\lastskip} ) */
# define max_non_prefixed_command_cmd last_item_cmd /* largest command code that can't be \.{\\global} */
toks_register_cmd, /* token list register ( \.{\\toks} ) */
@@ -195,15 +195,6 @@ typedef enum {
set_interaction_cmd, /* define level of interaction ( \.{\\batchmode}, etc.~) */
letterspace_font_cmd, /* letterspace a font ( \.{\\letterspacefont} ) */
pdf_copy_font_cmd, /* create a new font instance ( \.{\\pdfcopyfont} ) */
- set_ocp_cmd, /* Place a translation process in the stream */
- def_ocp_cmd, /* Define and load a translation process */
- set_ocp_list_cmd, /* Place a list of OCPs in the stream */
- def_ocp_list_cmd, /* Define a list of OCPs */
- clear_ocp_lists_cmd, /* Remove all active OCP lists */
- push_ocp_list_cmd, /* Add to the sequence of active OCP lists */
- pop_ocp_list_cmd, /* Remove from the sequence of active OCP lists */
- ocp_list_op_cmd, /* Operations for building a list of OCPs */
- ocp_trace_level_cmd, /* Tracing of active OCPs, either 0 or 1 */
undefined_cs_cmd, /* initial state of most |eq_type| fields */
expand_after_cmd, /* special expansion ( \.{\\expandafter} ) */
no_expand_cmd, /* special nonexpansion ( \.{\\noexpand} ) */
@@ -227,7 +218,7 @@ typedef enum {
data_cmd, /* the equivalent is simply a halfword number */
} tex_command_code;
-# define max_command_cmd ocp_trace_level_cmd /* the largest command code seen at |big_switch| */
+# define max_command_cmd pdf_copy_font_cmd /* the largest command code seen at |big_switch| */
# define last_cmd data_cmd
# define max_non_prefixed_command last_item_cmd
diff --git a/Build/source/texk/web2c/luatexdir/tex/commands.w b/Build/source/texk/web2c/luatexdir/tex/commands.w
index 83e81602840..db5a7672317 100644
--- a/Build/source/texk/web2c/luatexdir/tex/commands.w
+++ b/Build/source/texk/web2c/luatexdir/tex/commands.w
@@ -23,8 +23,8 @@
#include "ptexlib.h"
static const char _svn_version[] =
- "$Id: commands.w 3587 2010-04-03 14:32:25Z taco $"
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/commands.w $";
+ "$Id: commands.w 3849 2010-09-01 09:10:48Z taco $"
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/commands.w $";
@ The symbolic names for glue parameters are put into \TeX's hash table
by using the routine called |primitive|, defined below. Let us enter them
@@ -537,18 +537,6 @@ void initialize_commands(void)
primitive_tex("nullfont", set_font_cmd, null_font, 0);
cs_text(frozen_null_font) = maketexstring("nullfont");
eqtb[frozen_null_font] = eqtb[cur_val];
- /* $\Omega$ always knows at least one ocp, namely the null ocp.
- It does nothing. */
- primitive_omega("nullocp", set_ocp_cmd, null_ocp, 0);
- cs_text(frozen_null_ocp) = maketexstring("nullocp");
- eqtb[frozen_null_ocp] = eqtb[cur_val];
- geq_define(ocp_active_number_base, data_cmd, 0);
- geq_define(ocp_active_min_ptr_base, data_cmd, 0);
- geq_define(ocp_active_max_ptr_base, data_cmd, 0);
- /* $\Omega$ always knows at least one ocp list, namely the null ocp list. */
- primitive_omega("nullocplist", set_ocp_list_cmd, null_ocp_list, 0);
- cs_text(frozen_null_ocp_list) = maketexstring("nullocplist");
- eqtb[frozen_null_ocp_list] = eqtb[cur_val];
primitive_tex("span", tab_mark_cmd, span_code, tab_mark_cmd_code);
primitive_luatex("aligntab", tab_mark_cmd, tab_mark_cmd_code,
@@ -1037,20 +1025,6 @@ void initialize_commands(void)
primitive_pdftex("pdfglyphtounicode", extension_cmd,
pdf_glyph_to_unicode_code, 0);
- primitive_omega("ocp", def_ocp_cmd, 0, 0);
- primitive_omega("externalocp", def_ocp_cmd, 1, 0);
- primitive_omega("ocplist", def_ocp_list_cmd, 0, 0);
- primitive_omega("pushocplist", push_ocp_list_cmd, 0, 0);
- primitive_omega("popocplist", pop_ocp_list_cmd, 0, 0);
- primitive_omega("clearocplists", clear_ocp_lists_cmd, 0, 0);
- primitive_omega("addbeforeocplist", ocp_list_op_cmd, add_before_op, 0);
- primitive_omega("addafterocplist", ocp_list_op_cmd, add_after_op, 0);
- primitive_omega("removebeforeocplist", ocp_list_op_cmd, remove_before_op,
- 0);
- primitive_omega("removeafterocplist", ocp_list_op_cmd, remove_after_op, 0);
- primitive_omega("ocptracelevel", ocp_trace_level_cmd, 0, 0);
- set_equiv(ocp_trace_level_base, 0);
-
/* some of the internal integer parameters are not associated with actual
primitives at all. */
diff --git a/Build/source/texk/web2c/luatexdir/tex/conditional.w b/Build/source/texk/web2c/luatexdir/tex/conditional.w
index a0df81779d7..a4a327568ab 100644
--- a/Build/source/texk/web2c/luatexdir/tex/conditional.w
+++ b/Build/source/texk/web2c/luatexdir/tex/conditional.w
@@ -21,8 +21,8 @@
#include "ptexlib.h"
static const char _svn_version[] =
- "$Id: conditional.w 3587 2010-04-03 14:32:25Z taco $"
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/conditional.w $";
+ "$Id: conditional.w 3955 2010-11-12 13:28:03Z taco $"
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/conditional.w $";
@ @c
#define box(A) eqtb[box_base+(A)].hh.rh
@@ -187,7 +187,7 @@ static boolean test_for_cs(void)
while (p != null) {
if (m >= max_buf_stack) {
max_buf_stack = m + 4;
- if (max_buf_stack == buf_size)
+ if (max_buf_stack >= buf_size)
check_buffer_overflow(max_buf_stack);
}
s = token_chr(token_info(p));
diff --git a/Build/source/texk/web2c/luatexdir/tex/directions.h b/Build/source/texk/web2c/luatexdir/tex/directions.h
index bea50879b64..f7b3e784d07 100644
--- a/Build/source/texk/web2c/luatexdir/tex/directions.h
+++ b/Build/source/texk/web2c/luatexdir/tex/directions.h
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: directions.h 3523 2010-03-19 13:28:08Z taco $ */
+/* $Id: directions.h 3853 2010-09-03 18:05:14Z oneiros $ */
#ifndef DIRECTIONS_H
# define DIRECTIONS_H
@@ -33,7 +33,7 @@
# define dir_RTT 24
-/* # define dir_array_size 25 */ /* |dir_RTT + 1| */
+ /* # define dir_array_size 25 *//* |dir_RTT + 1| */
/* inv(primary) == tertiary */
/*
@@ -44,7 +44,7 @@ _is_mirrored[dir_LTL] = 0;
_is_mirrored[dir_RTT] = 0;
*/
-#define is_mirrored(a) 0
+# define is_mirrored(a) 0
/* secondary == tertiary */
/*
@@ -55,7 +55,7 @@ _is_rotated[dir_LTL] = 0;
_is_rotated[dir_RTT] = 1;
*/
-#define is_rotated(a) (a == dir_RTT)
+# define is_rotated(a) (a == dir_RTT)
/* secondary == secondary */
/*
@@ -78,7 +78,7 @@ _textdir_parallel[dir_RTT][dir_LTL] = 1;
_textdir_parallel[dir_RTT][dir_RTT] = 1;
*/
-#define textdir_parallel(a,b) (((a == dir_TLT || a == dir_TRT)&&(b == dir_TLT || b == dir_TRT)) || \
+# define textdir_parallel(a,b) (((a == dir_TLT || a == dir_TRT)&&(b == dir_TLT || b == dir_TRT)) || \
((a == dir_LTL || a == dir_RTT)&&(b == dir_LTL || b == dir_RTT)))
@@ -104,7 +104,7 @@ _pardir_parallel[dir_RTT][dir_RTT] = 1;
*/
-#define pardir_parallel(a,b) (((a == dir_TLT || a == dir_TRT)&&(b == dir_TLT || b == dir_TRT)) || \
+# define pardir_parallel(a,b) (((a == dir_TLT || a == dir_TRT)&&(b == dir_TLT || b == dir_TRT)) || \
((a == dir_LTL || a == dir_RTT)&&(b == dir_LTL || b == dir_RTT)))
@@ -129,7 +129,7 @@ _pardir_opposite[dir_RTT][dir_LTL] = 1;
_pardir_opposite[dir_RTT][dir_RTT] = 0;
*/
-#define pardir_opposite(a,b) ((a == dir_LTL && b == dir_RTT)||(a == dir_RTT && b == dir_LTL))
+# define pardir_opposite(a,b) ((a == dir_LTL && b == dir_RTT)||(a == dir_RTT && b == dir_LTL))
/* inv(secondary) == secondary */
@@ -153,7 +153,7 @@ _textdir_opposite[dir_RTT][dir_LTL] = 0;
_textdir_opposite[dir_RTT][dir_RTT] = 0;
*/
-#define textdir_opposite(a,b) ((a == dir_TLT && b == dir_TRT)||(a == dir_TRT && b == dir_TLT))
+# define textdir_opposite(a,b) ((a == dir_TLT && b == dir_TRT)||(a == dir_TRT && b == dir_TLT))
/* inv(tertiary) == tertiary */
@@ -177,7 +177,7 @@ _glyphdir_opposite[dir_RTT][dir_LTL] = 0;
_glyphdir_opposite[dir_RTT][dir_RTT] = 0;
*/
-#define glyphdir_opposite(a,b) 0
+# define glyphdir_opposite(a,b) 0
/* primary == primary */
@@ -201,7 +201,7 @@ _pardir_eq[dir_RTT][dir_LTL] = 0;
_pardir_eq[dir_RTT][dir_RTT] = 1;
*/
-#define pardir_eq(a,b) (((a == dir_TLT || a == dir_TRT)&&(b == dir_TLT || b == dir_TRT))|| \
+# define pardir_eq(a,b) (((a == dir_TLT || a == dir_TRT)&&(b == dir_TLT || b == dir_TRT))|| \
(a == dir_LTL && b == dir_LTL) || \
(a == dir_RTT && b == dir_RTT))
@@ -226,7 +226,7 @@ _textdir_eq[dir_RTT][dir_LTL] = 1;
_textdir_eq[dir_RTT][dir_RTT] = 1;
*/
-#define textdir_eq(a,b) ((a == dir_TLT && b == dir_TLT) || \
+# define textdir_eq(a,b) ((a == dir_TLT && b == dir_TLT) || \
(a == dir_TRT && b == dir_TRT) || \
(a == dir_LTL && (b == dir_LTL || b == dir_RTT)) || \
(a == dir_RTT && (b == dir_LTL || b == dir_RTT))
@@ -253,9 +253,9 @@ _glyphdir_eq[dir_RTT][dir_LTL] = 0;
_glyphdir_eq[dir_RTT][dir_RTT] = 1;
*/
-#define glyphdir_eq(a,b) ((a != dir_LTL && b != dir_LTL) || \
+# define glyphdir_eq(a,b) ((a != dir_LTL && b != dir_LTL) || \
(a == dir_LTL && b == dir_LTL))
-
+
/* primary == secondary */
/*
@@ -278,7 +278,7 @@ _partextdir_eq[dir_RTT][dir_LTL] = 0;
_partextdir_eq[dir_RTT][dir_RTT] = 0;
*/
-#define partextdir_eq(a,b) (((a == dir_TLT || a == dir_TRT)&&(b == dir_LTL || b == dir_RTT)) || \
+# define partextdir_eq(a,b) (((a == dir_TLT || a == dir_TRT)&&(b == dir_LTL || b == dir_RTT)) || \
(a == dir_LTL && b == dir_TLT) || \
(a == dir_RTT && b == dir_TRT))
@@ -292,7 +292,7 @@ _textglyphdir_orthogonal[dir_LTL] = 1;
_textglyphdir_orthogonal[dir_RTT] = 0;
*/
-#define textglyphdir_orthogonal(a) (a != dir_RTT)
+# define textglyphdir_orthogonal(a) (a != dir_RTT)
/* secondary == L */
/*
diff --git a/Build/source/texk/web2c/luatexdir/tex/directions.w b/Build/source/texk/web2c/luatexdir/tex/directions.w
index d89c407c7a9..15f03049bf4 100644
--- a/Build/source/texk/web2c/luatexdir/tex/directions.w
+++ b/Build/source/texk/web2c/luatexdir/tex/directions.w
@@ -22,7 +22,7 @@
static const char _svn_version[] =
"$Id: directions.w 3587 2010-04-03 14:32:25Z taco $"
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/directions.w $";
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/directions.w $";
@ @c
void scan_direction(void)
diff --git a/Build/source/texk/web2c/luatexdir/tex/dumpdata.h b/Build/source/texk/web2c/luatexdir/tex/dumpdata.h
index 44f7fabe96d..3b29ca6372d 100644
--- a/Build/source/texk/web2c/luatexdir/tex/dumpdata.h
+++ b/Build/source/texk/web2c/luatexdir/tex/dumpdata.h
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: dumpdata.h 3612 2010-04-13 09:29:42Z taco $ */
+/* $Id: dumpdata.h 3853 2010-09-03 18:05:14Z oneiros $ */
#ifndef DUMPDATA_H
# define DUMPDATA_H
@@ -38,9 +38,9 @@ extern boolean load_fmt_file(const char *);
extern void do_zdump(char *, int, int, FILE *);
extern void do_zundump(char *, int, int, FILE *);
-#if !defined (WORDS_BIGENDIAN) && !defined (NO_DUMP_SHARE) /* this fn */
-extern void swap_items(char *p, int nitems, int size); /* in luatex.c */
-#endif
+# if !defined (WORDS_BIGENDIAN) && !defined (NO_DUMP_SHARE) /* this fn */
+extern void swap_items(char *p, int nitems, int size); /* in luatex.c */
+# endif
/* Like do_undump, but check each value against LOW and HIGH. The
slowdown isn't significant, and this improves the chances of
diff --git a/Build/source/texk/web2c/luatexdir/tex/dumpdata.w b/Build/source/texk/web2c/luatexdir/tex/dumpdata.w
index 975fbb24c5f..8a58fa94144 100644
--- a/Build/source/texk/web2c/luatexdir/tex/dumpdata.w
+++ b/Build/source/texk/web2c/luatexdir/tex/dumpdata.w
@@ -21,8 +21,8 @@
#include "ptexlib.h"
static const char _svn_version[] =
- "$Id: dumpdata.w 3587 2010-04-03 14:32:25Z taco $"
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/dumpdata.w $";
+ "$Id: dumpdata.w 3849 2010-09-01 09:10:48Z taco $"
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/dumpdata.w $";
#define font_id_text(A) cs_text(font_id_base+(A))
#define prev_depth cur_list.prev_depth_field
@@ -62,6 +62,7 @@ void store_fmt_file(void)
halfword p; /* all-purpose pointer */
int x; /* something to dump */
char *format_engine;
+ int callback_id; /* |pre_dump| callback */
char *fmtname = NULL;
/* If dumping is not allowed, abort */
/* The user is not allowed to dump a format file unless |save_ptr=0|.
@@ -75,6 +76,10 @@ void store_fmt_file(void)
/* Create the |format_ident|, open the format file, and inform the user
that dumping has begun */
+ callback_id = callback_defined(pre_dump_callback);
+ if (callback_id > 0) {
+ (void) run_callback(callback_id, "->");
+ }
selector = new_string;
tprint(" (format=");
print(job_name);
@@ -284,11 +289,6 @@ void store_fmt_file(void)
print_char('s');
dump_math_data();
- /* Dump the ocp information */
- dump_active_ocp_info();
- dump_ocp_info();
- dump_ocplist_info();
-
/* Dump the hyphenation tables */
dump_language_data();
@@ -493,11 +493,6 @@ boolean load_fmt_file(const char *fmtname)
undump_math_data();
make_pdftex_banner();
- /* Undump the ocp information */
- undump_active_ocp_info();
- undump_ocp_info();
- undump_ocplist_info();
-
/* Undump the hyphenation tables */
undump_language_data();
diff --git a/Build/source/texk/web2c/luatexdir/tex/equivalents.h b/Build/source/texk/web2c/luatexdir/tex/equivalents.h
index 99894d4226a..c0616d91ad5 100644
--- a/Build/source/texk/web2c/luatexdir/tex/equivalents.h
+++ b/Build/source/texk/web2c/luatexdir/tex/equivalents.h
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: equivalents.h 3385 2010-01-26 05:45:55Z taco $ */
+/* $Id: equivalents.h 3853 2010-09-03 18:05:14Z oneiros $ */
#ifndef EQUIVALENTS_H
# define EQUIVALENTS_H
@@ -36,11 +36,6 @@ emphasize this distinction.
*/
# define font_base 0 /* smallest internal font number; must not be less than |min_quarterword| */
-# define ocp_base 0
-# define number_ocps 32768
-# define ocp_list_base 0
-# define number_ocp_lists 32768
-# define max_active_ocp_lists 32768
# define biggest_reg 65535 /* the largest allowed register number; must be |< max_quarterword| */
# define number_regs 65536 /* |biggest_reg+1| */
# define number_attrs 65536 /* total numbeer of attributes */
@@ -145,12 +140,7 @@ here, and the |number_regs| \.{\\dimen} registers.
# define frozen_special (frozen_control_sequence+12 ) /* permanent `\.{\\special}' */
# define frozen_null_font (frozen_control_sequence+13 ) /* permanent `\.{\\nullfont}' */
# define font_id_base (frozen_null_font-font_base ) /* begins table of |number_fonts| permanent font identifiers */
-# define frozen_null_ocp (frozen_null_font+number_fonts ) /* permanent `\.{\\nullocp}' */
-# define ocp_id_base (frozen_null_ocp-ocp_base )
- /* begins table of |number_ocps| permanent ocp identifiers */
-# define frozen_null_ocp_list (frozen_null_ocp+number_ocps ) /* permanent `\.{\\nullocplist}' */
-# define ocp_list_id_base (frozen_null_ocp_list-ocp_list_base ) /* begins table of |number_ocp_lists| permanent ocp list identifiers */
-# define undefined_control_sequence (frozen_null_ocp_list+number_ocp_lists)
+# define undefined_control_sequence (frozen_null_font+number_fonts)
# define glue_base (undefined_control_sequence+1) /* beginning of region 3 */
# define line_skip_code 0 /* interline glue if |baseline_skip| is infeasible */
@@ -200,12 +190,7 @@ here, and the |number_regs| \.{\\dimen} registers.
# define pdf_xform_resources_loc (pdftex_first_loc + 4) /* points to token list for \.{\\pdfxformresources} */
# define pdf_pk_mode_loc (pdftex_first_loc + 5) /* points to token list for \.{\\pdfpkmode} */
# define pdf_toks (pdftex_first_loc+6) /* end of \pdfTeX's token list parameters */
-# define ocp_trace_level_base (pdf_toks)
-# define ocp_active_number_base (ocp_trace_level_base+1)
-# define ocp_active_min_ptr_base (ocp_active_number_base+1)
-# define ocp_active_max_ptr_base (ocp_active_min_ptr_base+1)
-# define ocp_active_base (ocp_active_max_ptr_base+1)
-# define toks_base (ocp_active_base+max_active_ocp_lists) /* table of |number_regs| token list registers */
+# define toks_base (pdf_toks) /* table of |number_regs| token list registers */
# define etex_pen_base (toks_base+number_regs) /* start of table of \eTeX's penalties */
# define inter_line_penalties_loc (etex_pen_base) /* additional penalties between lines */
# define club_penalties_loc (etex_pen_base+1) /* penalties for creating club lines */
diff --git a/Build/source/texk/web2c/luatexdir/tex/equivalents.w b/Build/source/texk/web2c/luatexdir/tex/equivalents.w
index a7a425376c4..a3639112620 100644
--- a/Build/source/texk/web2c/luatexdir/tex/equivalents.w
+++ b/Build/source/texk/web2c/luatexdir/tex/equivalents.w
@@ -21,8 +21,8 @@
#include "ptexlib.h"
static const char _svn_version[] =
- "$Id: equivalents.w 3587 2010-04-03 14:32:25Z taco $"
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/equivalents.w $";
+ "$Id: equivalents.w 3849 2010-09-01 09:10:48Z taco $"
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/equivalents.w $";
@ @c
#define par_shape_ptr equiv(par_shape_loc)
@@ -1017,7 +1017,6 @@ void show_eqtb(halfword n)
print_int(vinfo(par_shape_ptr + 1));
}
} else if (n < toks_base) {
- /* TODO make extra cases for ocps here! */
print_cmd_chr(assign_toks_cmd, n);
print_char('=');
if (equiv(n) != null)
@@ -1130,7 +1129,6 @@ void show_eqtb_meaning(halfword n)
else
print_cmd_chr(set_etex_shape_cmd, n);
} else if (n < toks_base) {
- /* TODO make extra cases for ocps here! */
print_cmd_chr(assign_toks_cmd, n);
} else if (n < box_base) {
tprint_esc("toks");
diff --git a/Build/source/texk/web2c/luatexdir/tex/errors.w b/Build/source/texk/web2c/luatexdir/tex/errors.w
index 1a6ec9a46e0..3a5bb4c8647 100644
--- a/Build/source/texk/web2c/luatexdir/tex/errors.w
+++ b/Build/source/texk/web2c/luatexdir/tex/errors.w
@@ -22,7 +22,7 @@
static const char _svn_version[] =
"$Id: errors.w 3587 2010-04-03 14:32:25Z taco $"
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/errors.w $";
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/errors.w $";
@ @c
#define new_line_char int_par(new_line_char_code)
diff --git a/Build/source/texk/web2c/luatexdir/tex/expand.w b/Build/source/texk/web2c/luatexdir/tex/expand.w
index 4f92a2fdd95..1a203d0c0e2 100644
--- a/Build/source/texk/web2c/luatexdir/tex/expand.w
+++ b/Build/source/texk/web2c/luatexdir/tex/expand.w
@@ -21,8 +21,8 @@
#include "ptexlib.h"
static const char _svn_version[] =
- "$Id: expand.w 3587 2010-04-03 14:32:25Z taco $"
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/expand.w $";
+ "$Id: expand.w 3802 2010-08-07 12:03:08Z taco $"
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/expand.w $";
@ Only a dozen or so command codes |>max_command| can possibly be returned by
@@ -344,7 +344,7 @@ void manufacture_csname(void)
} else {
cur_cs = null_cs; /* the list is empty */
}
- xfree(ss->s);
+ free_lstring(ss);
flush_list(r);
if (eq_type(cur_cs) == undefined_cs_cmd) {
eq_define(cur_cs, relax_cmd, too_big_char); /* N.B.: The |save_stack| might change */
diff --git a/Build/source/texk/web2c/luatexdir/tex/extensions.w b/Build/source/texk/web2c/luatexdir/tex/extensions.w
index 62c9e65fa8a..38e91d0a94e 100644
--- a/Build/source/texk/web2c/luatexdir/tex/extensions.w
+++ b/Build/source/texk/web2c/luatexdir/tex/extensions.w
@@ -22,8 +22,8 @@
@ @c
static const char _svn_version[] =
- "$Id: extensions.w 3587 2010-04-03 14:32:25Z taco $"
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/extensions.w $";
+ "$Id: extensions.w 3851 2010-09-03 11:55:16Z taco $"
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/extensions.w $";
#include "ptexlib.h"
@@ -208,7 +208,7 @@ void do_extension(PDF pdf)
true);
do_extension(pdf); /* scan form and set |pdf_last_xform| */
pdf_cur_form = pdf_last_xform;
- ship_out(pdf, obj_xform_box(pdf, pdf_last_xform), false);
+ ship_out(pdf, obj_xform_box(pdf, pdf_last_xform), SHIPPING_FORM);
break;
case pdf_ximage_code:
check_o_mode(pdf, "\\immediate\\pdfximage", 1 << OMODE_PDF,
@@ -500,7 +500,7 @@ void do_extension(PDF pdf)
break;
case late_lua_node:
/* Implement \.{\\latelua} */
- new_whatsit(late_lua_node);
+ new_whatsit(late_lua_node); /* type == normal */
late_lua_name(tail) = scan_lua_state();
(void) scan_toks(false, false);
late_lua_data(tail) = def_ref;
diff --git a/Build/source/texk/web2c/luatexdir/tex/filename.w b/Build/source/texk/web2c/luatexdir/tex/filename.w
index 4757bfc19cd..77776a50087 100644
--- a/Build/source/texk/web2c/luatexdir/tex/filename.w
+++ b/Build/source/texk/web2c/luatexdir/tex/filename.w
@@ -21,8 +21,8 @@
#include "ptexlib.h"
static const char _svn_version[] =
- "$Id: filename.w 3587 2010-04-03 14:32:25Z taco $ "
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/filename.w $";
+ "$Id: filename.w 3802 2010-08-07 12:03:08Z taco $ "
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/filename.w $";
@ In order to isolate the system-dependent aspects of file names, the
@@ -107,6 +107,7 @@ static void end_name(void)
cur_string[area_delimiter] = '\0';
cur_length = (unsigned) strlen((char *) cur_string);
cur_area = make_string();
+ xfree(cur_string);
cur_length = (unsigned) strlen((char *) s);
cur_string = s;
}
@@ -119,6 +120,7 @@ static void end_name(void)
cur_string[l] = '\0';
cur_length = (unsigned) strlen((char *) cur_string);
cur_name = make_string();
+ xfree(cur_string);
cur_length = (unsigned) strlen((char *) s);
cur_string = s;
cur_ext = make_string();
diff --git a/Build/source/texk/web2c/luatexdir/tex/inputstack.h b/Build/source/texk/web2c/luatexdir/tex/inputstack.h
index 428bd9d2adb..246bc93e9e2 100644
--- a/Build/source/texk/web2c/luatexdir/tex/inputstack.h
+++ b/Build/source/texk/web2c/luatexdir/tex/inputstack.h
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: inputstack.h 3720 2010-06-13 08:04:27Z taco $ */
+/* $Id: inputstack.h 3853 2010-09-03 18:05:14Z oneiros $ */
#ifndef INPUTSTACK_H
# define INPUTSTACK_H 1
@@ -33,10 +33,8 @@ typedef struct in_state_record {
halfword loc_field;
halfword limit_field;
halfword name_field;
- halfword ocp_lstack_field; /* used for omega translation processes */
int synctex_tag_field; /* stack the tag of the current file */
- signed int ocp_no_field:16; /* used for omega translation processes */
- signed int cattable_field:16; /* category table used by the current line (see textoken.c) */
+ signed int cattable_field:16; /* category table used by the current line (see textoken.c) */
quarterword state_field:8;
quarterword index_field:8;
boolean partial_field:8; /* is the current line partial? (see textoken.c) */
@@ -56,8 +54,6 @@ extern in_state_record cur_input; /* the ``top'' input state */
# define iname cur_input.name_field /* name of the current file */
# define nofilter cur_input.nofilter_field /* is token filtering explicitly disallowed? */
# define synctex_tag cur_input.synctex_tag_field /* tag of the current file */
-# define current_ocp_lstack cur_input.ocp_lstack_field /* name of the current ocp */
-# define current_ocp_no cur_input.ocp_no_field /* name of the current ocp */
# define line_catcode_table cur_input.cattable_field
# define line_partial cur_input.partial_field
diff --git a/Build/source/texk/web2c/luatexdir/tex/inputstack.w b/Build/source/texk/web2c/luatexdir/tex/inputstack.w
index 3e1c33bd9b8..857f86dfe6e 100644
--- a/Build/source/texk/web2c/luatexdir/tex/inputstack.w
+++ b/Build/source/texk/web2c/luatexdir/tex/inputstack.w
@@ -21,8 +21,8 @@
#include "ptexlib.h"
static const char _svn_version[] =
- "$Id: inputstack.w 3612 2010-04-13 09:29:42Z taco $ "
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/inputstack.w $";
+ "$Id: inputstack.w 3849 2010-09-01 09:10:48Z taco $ "
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/inputstack.w $";
@ @c
#define end_line_char int_par(end_line_char_code)
@@ -286,14 +286,7 @@ void show_context(void)
/* we omit backed-up token lists that have already been read */
tally = 0; /* get ready to count characters */
old_setting = selector;
- if (current_ocp_lstack > 0) {
- tprint_nl("OCP stack ");
- print_scaled(current_ocp_lstack);
- tprint(" entry ");
- print_int(current_ocp_no);
- tprint(":");
- PSEUDO_PRINT_THE_LINE();
- } else if (istate != token_list) {
+ if (istate != token_list) {
/* Print location of current line */
/*
This routine should be changed, if necessary, to give the best possible
@@ -623,8 +616,6 @@ void initialize_inputstack(void)
iindex = 0;
line = 0;
iname = 0;
- current_ocp_lstack = 0;
- current_ocp_no = 0;
nofilter = false;
force_eof = false;
luacstrings = 0;
diff --git a/Build/source/texk/web2c/luatexdir/tex/linebreak.h b/Build/source/texk/web2c/luatexdir/tex/linebreak.h
index 791a5f0de7c..e91b3f2fa27 100644
--- a/Build/source/texk/web2c/luatexdir/tex/linebreak.h
+++ b/Build/source/texk/web2c/luatexdir/tex/linebreak.h
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: linebreak.h 3526 2010-03-19 20:56:38Z taco $ */
+/* $Id: linebreak.h 3853 2010-09-03 18:05:14Z oneiros $ */
#ifndef LINEBREAK_H
# define LINEBREAK_H
@@ -68,13 +68,13 @@ extern void ext_do_line_break(int paragraph_dir,
int broken_penalty, halfword final_par_glue,
halfword pdf_ignored_dimen);
-extern void get_linebreak_info (int *, int *) ;
+extern void get_linebreak_info(int *, int *);
extern halfword find_protchar_left(halfword l, boolean d);
extern halfword find_protchar_right(halfword l, halfword r);
/* skipable nodes at the margins during character protrusion */
-#define cp_skipable(a) ((! is_char_node((a))) && \
+# define cp_skipable(a) ((! is_char_node((a))) && \
((type((a)) == ins_node) \
|| (type((a)) == mark_node) \
|| (type((a)) == adjust_node) \
diff --git a/Build/source/texk/web2c/luatexdir/tex/linebreak.w b/Build/source/texk/web2c/luatexdir/tex/linebreak.w
index f5b958eb9bd..1478839f8d6 100644
--- a/Build/source/texk/web2c/luatexdir/tex/linebreak.w
+++ b/Build/source/texk/web2c/luatexdir/tex/linebreak.w
@@ -21,8 +21,8 @@
#include "ptexlib.h"
static const char _svn_version[] =
- "$Id: linebreak.w 3587 2010-04-03 14:32:25Z taco $ "
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/linebreak.w $";
+ "$Id: linebreak.w 3995 2010-11-28 09:49:37Z taco $ "
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/linebreak.w $";
@ We come now to what is probably the most interesting algorithm of \TeX:
the mechanism for choosing the ``best possible'' breakpoints that yield
@@ -139,14 +139,21 @@ void line_break(boolean d, int line_break_context)
lua_linebreak_callback(d, temp_head,
addressof(cur_list.tail_field));
if (callback_id > 0) {
- just_box = cur_list.tail_field;
- if (just_box != null)
- while (vlink(just_box) != null)
- just_box = vlink(just_box);
- if ((just_box == null) || (type(just_box) != hlist_node)) {
+ /* find the correct value for the |just_box| */
+ halfword box_search = cur_list.tail_field;
+ just_box = null;
+ if (box_search != null) {
+ do {
+ if (type(box_search) == hlist_node) {
+ just_box = box_search;
+ }
+ box_search = vlink(box_search);
+ } while (box_search != null);
+ }
+ if (just_box == null) {
help3
("A linebreaking routine should return a non-empty list of nodes",
- "and the last one of those has to be a \\hbox.",
+ "and at least one of those has to be a \\hbox.",
"Sorry, I cannot recover from this.");
print_err("Invalid linebreak_filter");
succumb();
@@ -898,8 +905,6 @@ compute_break_width(int break_type, int line_break_dir, int pdf_adjust_spacing,
} else {
s = null;
}
- } else {
- s = p; /* unhyphenated: we need to 'skip' any 'whitespace' following */
}
while (s != null) {
switch (type(s)) {
@@ -1781,7 +1786,7 @@ ext_do_line_break(int paragraph_dir,
/* LOCAL: Initialize with first |local_paragraph| node */
if ((cur_p != null) && (type(cur_p) == whatsit_node)
&& (subtype(cur_p) == local_par_node)) {
- assert(alink(cur_p) == temp_head);
+ alink(cur_p) = temp_head; /* this used to be an assert, but may as well force it */
internal_pen_inter = local_pen_inter(cur_p);
internal_pen_broken = local_pen_broken(cur_p);
init_internal_left_box = local_box_left(cur_p);
diff --git a/Build/source/texk/web2c/luatexdir/tex/mainbody.h b/Build/source/texk/web2c/luatexdir/tex/mainbody.h
index 93794932cc9..98434521776 100644
--- a/Build/source/texk/web2c/luatexdir/tex/mainbody.h
+++ b/Build/source/texk/web2c/luatexdir/tex/mainbody.h
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: mainbody.h 3612 2010-04-13 09:29:42Z taco $ */
+/* $Id: mainbody.h 3911 2010-10-16 07:28:11Z taco $ */
#ifndef MAINBODY_H
# define MAINBODY_H
@@ -37,7 +37,7 @@ in production versions of \TeX.
@^system dependencies@>
*/
-# define ssup_max_strings 262143
+# define ssup_max_strings 2097151
# define inf_max_strings 100000
# define sup_max_strings ssup_max_strings
@@ -54,7 +54,7 @@ in production versions of \TeX.
# define sup_max_in_open 127
# define inf_param_size 60
-# define sup_param_size 6000
+# define sup_param_size 32767
# define inf_save_size 600
# define sup_save_size 80000
@@ -68,15 +68,8 @@ in production versions of \TeX.
# define sup_hash_extra sup_max_strings
# define inf_hash_extra 0
-# define sup_ocp_list_size 1000000
-# define inf_ocp_list_size 1000
-# define sup_ocp_buf_size 100000000
-# define inf_ocp_buf_size 1000
-# define sup_ocp_stack_size 1000000
-# define inf_ocp_stack_size 1000
-
# define inf_expand_depth 100
-# define sup_expand_depth 1000000
+# define sup_expand_depth 10000000
# include <stdio.h>
@@ -136,9 +129,6 @@ extern char *bound_name;
extern int error_line;
extern int half_error_line;
extern int max_print_line;
-extern int ocp_list_size;
-extern int ocp_buf_size;
-extern int ocp_stack_size;
extern int max_strings;
extern int strings_free;
extern int font_k;
diff --git a/Build/source/texk/web2c/luatexdir/tex/mainbody.w b/Build/source/texk/web2c/luatexdir/tex/mainbody.w
index fea85fa31be..93ea9018d13 100644
--- a/Build/source/texk/web2c/luatexdir/tex/mainbody.w
+++ b/Build/source/texk/web2c/luatexdir/tex/mainbody.w
@@ -25,8 +25,8 @@
#include "ptexlib.h"
static const char _svn_version[] =
- "$Id: mainbody.w 3587 2010-04-03 14:32:25Z taco $"
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/mainbody.w $";
+ "$Id: mainbody.w 4061 2011-01-11 19:31:03Z hhenkel $"
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/mainbody.w $";
@
pdfTeX is copyright (C) 1996-2006 Han The Thanh, <thanh@@pdftex.org>.
@@ -206,9 +206,6 @@ int error_line; /* width of context lines on terminal error mess
int half_error_line; /* width of first lines of contexts in terminal
error messages; should be between 30 and |error_line-15| */
int max_print_line; /* width of longest text lines output; should be at least 60 */
-int ocp_list_size;
-int ocp_buf_size;
-int ocp_stack_size;
int max_strings; /* maximum number of strings; must not exceed |max_halfword| */
int strings_free; /* strings available after format loaded */
int font_k; /* loop variable for initialization */
@@ -301,9 +298,6 @@ int main_initialize(void)
setup_bound_var(79, "error_line", error_line);
setup_bound_var(50, "half_error_line", half_error_line);
setup_bound_var(79, "max_print_line", max_print_line);
- setup_bound_var(1000, "ocp_list_size", ocp_list_size);
- setup_bound_var(1000, "ocp_buf_size", ocp_buf_size);
- setup_bound_var(1000, "ocp_stack_size", ocp_stack_size);
setup_bound_var(0, "hash_extra", hash_extra);
setup_bound_var(72, "pk_dpi", pk_dpi);
setup_bound_var(10000, "expand_depth", expand_depth);
@@ -338,8 +332,6 @@ int main_initialize(void)
full_source_filename_stack = xmallocarray(char *, (unsigned) max_in_open);
param_stack = xmallocarray(halfword, (unsigned) param_size);
dvi_buf = xmallocarray(eight_bits, (unsigned) dvi_buf_size);
- initialize_ocplist_arrays(ocp_list_size);
- initialize_ocp_buffers(ocp_buf_size, ocp_stack_size);
if (ini_version) {
fixmem = xmallocarray(smemory_word, fix_mem_init + 1);
@@ -451,7 +443,7 @@ void main_body(void)
if (pdf_output_option != 0)
int_par(pdf_output_code) = pdf_output_value;
if (pdf_draftmode_option != 0)
- int_par(pdf_draftmode_code) = pdf_draftmode_value;
+ pdf_draftmode = static_pdf->draftmode = pdf_draftmode_value;
pdf_init_map_file((char *) pdftex_map);
if (end_line_char_inactive())
decr(ilimit);
diff --git a/Build/source/texk/web2c/luatexdir/tex/maincontrol.h b/Build/source/texk/web2c/luatexdir/tex/maincontrol.h
index e07f1e23cd9..daa2527a0a0 100644
--- a/Build/source/texk/web2c/luatexdir/tex/maincontrol.h
+++ b/Build/source/texk/web2c/luatexdir/tex/maincontrol.h
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: maincontrol.h 3354 2010-01-11 08:49:33Z taco $ */
+/* $Id: maincontrol.h 3752 2010-07-27 10:18:24Z taco $ */
#ifndef MAINCONTROL_H
# define MAINCONTROL_H
@@ -157,6 +157,7 @@ extern void fixup_directions(void);
# define is_int_assign(cmd) (cmd==assign_int_cmd)
# define is_dim_assign(cmd) (cmd==assign_dimen_cmd)
+# define is_glue_assign(cmd) (cmd==assign_glue_cmd)
# define is_toks_assign(cmd) (cmd==assign_toks_cmd)
# define show_code 0 /* \.{\\show} */
diff --git a/Build/source/texk/web2c/luatexdir/tex/maincontrol.w b/Build/source/texk/web2c/luatexdir/tex/maincontrol.w
index 38b508f31d3..6b17a5bdb8d 100644
--- a/Build/source/texk/web2c/luatexdir/tex/maincontrol.w
+++ b/Build/source/texk/web2c/luatexdir/tex/maincontrol.w
@@ -19,8 +19,8 @@
@ @c
static const char _svn_version[] =
- "$Id: maincontrol.w 3659 2010-04-28 15:10:32Z taco $"
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/maincontrol.w $";
+ "$Id: maincontrol.w 4023 2010-12-05 15:10:06Z taco $"
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/maincontrol.w $";
#include "ptexlib.h"
@@ -178,716 +178,737 @@ is very welcome, which is why I need to have the next two globals:
internal_font_number space_spec_font;
halfword space_spec_cache;
-@ for mode-independent commands, the following macros is useful:
+@ To handle the execution state of |main_control|'s eternal loop,
+an extra global variable is used, along with a macro to define
+its values.
@c
-#define any_mode(A) vmode+(A): case hmode+(A): case mmode+(A)
+#define goto_next 0
+#define goto_skip_token 1
+#define goto_return 2
+static int main_control_state;
-@ There is a list of cases where the user has probably gotten into or out of math
-mode by mistake. \TeX\ will insert a dollar sign and rescan the current token.
+@* Main control helpers.
+
+Here are all the functions that are called from |main_control| that
+are not already defined elsewhere. For the moment, this list simply
+in the order that the appear in |init_main_control|, below.
+
+@
@c
-#define non_math(A) vmode+(A): case hmode+(A)
+static void run_char_num (void) {
+ scan_char_num();
+ cur_chr = cur_val;
+ adjust_space_factor();
+ tail_append(new_char(cur_font, cur_chr));
+}
+
+static void run_char (void) {
+ adjust_space_factor();
+ tail_append(new_char(cur_font, cur_chr));
+}
-@ @c
-void main_control(void)
-{ /* governs \TeX's activities */
- int t; /* general-purpose temporary variable */
- halfword p; /* for whatsit nodes and testing whether an auto kern should be inserted */
- int chr_stack; /* to temporarily save an |cur_chr| to be appended */
- mathcodeval mval; /* to build up an argument to |set_math_char| */
- t = 0; /* for -Wall */
- chr_stack = -1;
- if (equiv(every_job_loc) != null)
- begin_token_list(equiv(every_job_loc), every_job_text);
+@
+The occurrence of blank spaces is almost part of \TeX's inner loop,
+since we usually encounter about one space for every five non-blank characters.
+Therefore |main_control| gives second-highest priority to ordinary spaces.
- BIG_SWITCH:
- get_x_token();
+When a glue parameter like \.{\\spaceskip} is set to `\.{0pt}', we will
+see to it later that the corresponding glue specification is precisely
+|zero_glue|, not merely a pointer to some specification that happens
+to be full of zeroes. Therefore it is simple to test whether a glue parameter
+is zero or~not.
- RESWITCH:
- /* Give diagnostic information, if requested */
- /* When a new token has just been fetched at |big_switch|, we have an
- ideal place to monitor \TeX's activity. */
- if (interrupt != 0) {
- if (OK_to_interrupt) {
- back_input();
- check_interrupt();
- goto BIG_SWITCH;
- }
- }
- if (int_par(tracing_commands_code) > 0)
- show_cur_cmd_chr();
- switch (abs(mode) + cur_cmd) {
- case hmode + letter_cmd:
- case hmode + other_char_cmd:
- case hmode + char_given_cmd:
- case hmode + char_num_cmd:
- if (abs(mode) + cur_cmd == hmode + char_num_cmd) {
- scan_char_num();
- cur_chr = cur_val;
- }
- if (is_last_ocp(current_ocp_lstack, current_ocp_no)) {
- /* Append character |cur_chr| and the following characters (if~any)
- to the current hlist in the current font; |goto reswitch| when
- a non-character has been fetched */
- CONTINUE:
- adjust_space_factor();
- chr_stack = cur_chr;
- tail_append(new_char(cur_font, chr_stack));
- get_x_token();
- if ((cur_cmd == letter_cmd) || (cur_cmd == other_char_cmd) ||
- (cur_cmd == char_given_cmd) || (cur_cmd == char_num_cmd)) {
- if (cur_cmd == char_num_cmd) {
- scan_char_num();
- cur_chr = cur_val;
- }
- if ((chr_stack == ex_hyphen_char) && (cur_chr != ex_hyphen_char)
- && (mode > 0)) {
- tail = compound_word_break(tail, cur_lang);
- subtype(tail) = automatic_disc;
- }
- goto CONTINUE;
- } else {
- if ((chr_stack == ex_hyphen_char) && (mode > 0)) {
- tail = compound_word_break(tail, cur_lang);
- subtype(tail) = automatic_disc;
- }
- chr_stack = -1;
- goto RESWITCH;
+@c
+static void run_app_space (void) {
+ if ((abs(mode) + cur_cmd == hmode + spacer_cmd)
+ && (!(space_factor == 1000))) {
+ app_space();
+ } else {
+ /* Append a normal inter-word space to the current list */
+ if (space_skip == zero_glue) {
+ /* Find the glue specification, |main_p|, for
+ text spaces in the current font */
+ if (cur_font != space_spec_font) {
+ if (space_spec_cache != zero_glue)
+ delete_glue_ref(space_spec_cache);
+ space_spec_cache = new_spec(zero_glue);
+ width(space_spec_cache) = space(cur_font);
+ stretch(space_spec_cache) = space_stretch(cur_font);
+ shrink(space_spec_cache) = space_shrink(cur_font);
+ space_spec_font = cur_font;
}
+ main_p = space_spec_cache;
+ temp_ptr = new_glue(main_p);
} else {
- /* Create a buffer with character |cur_chr| and the following
- characters (if~any) and then apply the current active OCP filter
- to this buffer */
- run_ocp();
- goto BIG_SWITCH;
-
+ temp_ptr = new_param_glue(space_skip_code);
}
- break;
- case hmode + spacer_cmd:
- case hmode + ex_space_cmd:
- case mmode + ex_space_cmd:
- if ((abs(mode) + cur_cmd == hmode + spacer_cmd)
- && (!(space_factor == 1000))) {
- app_space();
- } else {
- /* Append a normal inter-word space to the current list */
- /* The occurrence of blank spaces is almost part of \TeX's inner loop,
- since we usually encounter about one space for every five non-blank characters.
- Therefore |main_control| gives second-highest priority to ordinary spaces.
-
- When a glue parameter like \.{\\spaceskip} is set to `\.{0pt}', we will
- see to it later that the corresponding glue specification is precisely
- |zero_glue|, not merely a pointer to some specification that happens
- to be full of zeroes. Therefore it is simple to test whether a glue parameter
- is zero or~not.
- */
- if (space_skip == zero_glue) {
- /* Find the glue specification, |main_p|, for
- text spaces in the current font */
- if (cur_font != space_spec_font) {
- if (space_spec_cache != zero_glue)
- delete_glue_ref(space_spec_cache);
- space_spec_cache = new_spec(zero_glue);
- width(space_spec_cache) = space(cur_font);
- stretch(space_spec_cache) = space_stretch(cur_font);
- shrink(space_spec_cache) = space_shrink(cur_font);
- space_spec_font = cur_font;
- }
- main_p = space_spec_cache;
+ couple_nodes(tail,temp_ptr);
+ tail = temp_ptr;
- temp_ptr = new_glue(main_p);
- } else {
- temp_ptr = new_param_glue(space_skip_code);
- }
- vlink(tail) = temp_ptr;
- tail = temp_ptr;
-
- }
- break;
+ }
+}
- case hmode + no_boundary_cmd:
- /* Append a |cancel_boundary_node| */
- new_whatsit(cancel_boundary_node);
- break;
- case hmode + char_ghost_cmd:
- t = cur_chr;
- get_x_token();
- if ((cur_cmd == letter_cmd) || (cur_cmd == other_char_cmd)
- || (cur_cmd == char_given_cmd) || (cur_cmd == char_num_cmd)) {
- p = new_glyph(get_cur_font(), cur_chr);
- if (t == 0) {
- set_is_leftghost(p);
- } else {
- set_is_rightghost(p);
- }
- tail_append(p);
- }
- break;
- /* Cases of |main_control| that are not part of the inner loop */
- case any_mode(relax_cmd):
- case vmode + spacer_cmd:
- case mmode + spacer_cmd:
- case mmode + no_boundary_cmd:
- break;
- case any_mode(ignore_spaces_cmd):
- if (cur_chr == 0) {
- /* Get the next non-blank non-call... */
- do {
- get_x_token();
- } while (cur_cmd == spacer_cmd);
+@ Append a |cancel_boundary_node|
+@c
+static void run_no_boundary (void) {
+ new_whatsit(cancel_boundary_node);
+}
- goto RESWITCH;
+@ @c
+static void run_char_ghost (void) {
+ int t;
+ t = cur_chr;
+ get_x_token();
+ if ((cur_cmd == letter_cmd) || (cur_cmd == other_char_cmd)
+ || (cur_cmd == char_given_cmd) || (cur_cmd == char_num_cmd)) {
+ halfword p = new_glyph(get_cur_font(), cur_chr);
+ if (t == 0) {
+ set_is_leftghost(p);
} else {
- t = scanner_status;
- scanner_status = normal;
- get_token_lua();
- scanner_status = t;
- cur_cs = prim_lookup(cs_text(cur_cs));
- if (cur_cs != undefined_primitive) {
- cur_cmd = get_prim_eq_type(cur_cs);
- cur_chr = get_prim_equiv(cur_cs);
- cur_tok = (cur_cmd * STRING_OFFSET) + cur_chr;
- goto RESWITCH;
- }
+ set_is_rightghost(p);
}
- break;
- case vmode + stop_cmd:
- if (its_all_over())
- return; /* this is the only way out */
- break;
- /* Math cases in non-math modes */
- case vmode + math_char_num_cmd:
- case vmode + math_given_cmd:
- case vmode + omath_given_cmd:
- case vmode + xmath_given_cmd:
- back_input();
- new_graf(true);
- break;
- case hmode + math_char_num_cmd:
- if (cur_chr == 0)
- mval = scan_mathchar(tex_mathcode);
- else if (cur_chr == 1)
- mval = scan_mathchar(aleph_mathcode);
- else if (cur_chr == 2)
- mval = scan_mathchar(xetex_mathcode);
- else
- mval = scan_mathchar(xetexnum_mathcode);
- math_char_in_text(mval);
- break;
- case hmode + math_given_cmd:
- mval = mathchar_from_integer(cur_chr, tex_mathcode);
- math_char_in_text(mval);
- break;
- case hmode + omath_given_cmd:
- mval = mathchar_from_integer(cur_chr, aleph_mathcode);
- math_char_in_text(mval);
- break;
- case hmode + xmath_given_cmd:
- mval = mathchar_from_integer(cur_chr, xetex_mathcode);
- math_char_in_text(mval);
- break;
-
- /* Forbidden cases detected in |main_control| */
- case vmode + vmove_cmd:
- case hmode + hmove_cmd:
- case mmode + hmove_cmd:
- case any_mode(last_item_cmd):
- case vmode + vadjust_cmd:
- case vmode + ital_corr_cmd:
- case non_math(eq_no_cmd):
- case any_mode(mac_param_cmd):
- /* When erroneous situations arise, \TeX\ usually issues an error message
- specific to the particular error. For example, `\.{\\noalign}' should
- not appear in any mode, since it is recognized by the |align_peek| routine
- in all of its legitimate appearances; a special error message is given
- when `\.{\\noalign}' occurs elsewhere. But sometimes the most appropriate
- error message is simply that the user is not allowed to do what he or she
- has attempted. For example, `\.{\\moveleft}' is allowed only in vertical mode,
- and `\.{\\lower}' only in non-vertical modes. Such cases are enumerated
- here and in the other sections referred to under `See also \dots.'
- */
- report_illegal_case();
- break;
+ tail_append(p);
+ }
+}
- /* Math-only cases in non-math modes, or vice versa */
- case non_math(sup_mark_cmd):
- case non_math(sub_mark_cmd):
- case non_math(super_sub_script_cmd):
- case non_math(math_comp_cmd):
- case non_math(delim_num_cmd):
- case non_math(left_right_cmd):
- case non_math(above_cmd):
- case non_math(radical_cmd):
- case non_math(math_style_cmd):
- case non_math(math_choice_cmd):
- case non_math(vcenter_cmd):
- case non_math(non_script_cmd):
- case non_math(mkern_cmd):
- case non_math(limit_switch_cmd):
- case non_math(mskip_cmd):
- case non_math(math_accent_cmd):
- case mmode + endv_cmd:
- case mmode + par_end_cmd:
- case mmode + stop_cmd:
- case mmode + vskip_cmd:
- case mmode + un_vbox_cmd:
- case mmode + valign_cmd:
- case mmode + hrule_cmd:
- insert_dollar_sign();
- break;
- /* Cases of |main_control| that build boxes and lists */
- case vmode + hrule_cmd:
- case hmode + vrule_cmd:
- case mmode + vrule_cmd:
- /* The most important parts of |main_control| are concerned with \TeX's
- chief mission of box-making. We need to control the activities that put
- entries on vlists and hlists, as well as the activities that convert
- those lists into boxes. All of the necessary machinery has already been
- developed; it remains for us to ``push the buttons'' at the right times.
-
- As an introduction to these routines, let's consider one of the simplest
- cases: What happens when `\.{\\hrule}' occurs in vertical mode, or
- `\.{\\vrule}' in horizontal mode or math mode? The code in |main_control|
- is short, since the |scan_rule_spec| routine already does most of what is
- required; thus, there is no need for a special action procedure.
-
- Note that baselineskip calculations are disabled after a rule in vertical
- mode, by setting |prev_depth:=pdf_ignored_dimen|.
- */
- tail_append(scan_rule_spec());
- if (abs(mode) == vmode)
- prev_depth = pdf_ignored_dimen;
- else if (abs(mode) == hmode)
- space_factor = 1000;
- break;
+@ @c
+static void run_relax (void) {
+ return;
+}
- case vmode + vskip_cmd:
- case hmode + hskip_cmd:
- case mmode + hskip_cmd:
- case mmode + mskip_cmd:
- /* The processing of things like \.{\\hskip} and \.{\\vskip} is slightly
- more complicated. But the code in |main_control| is very short, since
- it simply calls on the action routine |append_glue|. Similarly, \.{\\kern}
- activates |append_kern|. */
- append_glue();
- break;
- case any_mode(kern_cmd):
- case mmode + mkern_cmd:
- append_kern();
- break;
-
- case non_math(left_brace_cmd):
- /* Many of the actions related to box-making are triggered by the appearance
- of braces in the input. For example, when the user says `\.{\\hbox}
- \.{to} \.{100pt\{$\langle\,\hbox{hlist}\,\rangle$\}}' in vertical mode,
- the information about the box size (100pt, |exactly|) is put onto |save_stack|
- with a level boundary word just above it, and |cur_group:=adjusted_hbox_group|;
- \TeX\ enters restricted horizontal mode to process the hlist. The right
- brace eventually causes |save_stack| to be restored to its former state,
- at which time the information about the box size (100pt, |exactly|) is
- available once again; a box is packaged and we leave restricted horizontal
- mode, appending the new box to the current list of the enclosing mode
- (in this case to the current list of vertical mode), followed by any
- vertical adjustments that were removed from the box by |hpack|.
-
- The next few sections of the program are therefore concerned with the
- treatment of left and right curly braces.
-
- If a left brace occurs in the middle of a page or paragraph, it simply
- introduces a new level of grouping, and the matching right brace will not have
- such a drastic effect. Such grouping affects neither the mode nor the
- current list. */
- new_save_level(simple_group);
- eq_word_define(int_base + no_local_whatsits_code, 0);
- eq_word_define(int_base + no_local_dirs_code, 0);
- break;
- case any_mode(begin_group_cmd):
- new_save_level(semi_simple_group);
- eq_word_define(int_base + no_local_whatsits_code, 0);
- eq_word_define(int_base + no_local_dirs_code, 0);
- break;
- case any_mode(end_group_cmd):
- if (cur_group == semi_simple_group) {
- fixup_directions();
- } else {
- off_save();
+@ |ignore_spaces| is a special case: after it has acted, |get_x_token| has already
+fetched the next token from the input, so that operation in |main_control|
+should be skipped.
+
+@c
+static void run_ignore_spaces (void) {
+ if (cur_chr == 0) {
+ /* Get the next non-blank non-call... */
+ do {
+ get_x_token();
+ } while (cur_cmd == spacer_cmd);
+
+ main_control_state = goto_skip_token;
+ } else {
+ int t = scanner_status;
+ scanner_status = normal;
+ get_token_lua();
+ scanner_status = t;
+ cur_cs = prim_lookup(cs_text(cur_cs));
+ if (cur_cs != undefined_primitive) {
+ cur_cmd = get_prim_eq_type(cur_cs);
+ cur_chr = get_prim_equiv(cur_cs);
+ cur_tok = (cur_cmd * STRING_OFFSET) + cur_chr;
+ main_control_state = goto_skip_token;
}
- break;
- case any_mode(right_brace_cmd):
- handle_right_brace();
- break;
+ }
+}
- case vmode + hmove_cmd:
- case hmode + vmove_cmd:
- case mmode + vmove_cmd:
- /* Constructions that require a box are started by calling |scan_box| with
- a specified context code. The |scan_box| routine verifies
- that a |make_box| command comes next and then it calls |begin_box|.
- */
- t = cur_chr;
- scan_normal_dimen();
- if (t == 0)
- scan_box(cur_val);
- else
- scan_box(-cur_val);
- break;
- case any_mode(leader_ship_cmd):
- scan_box(leader_flag - a_leaders + cur_chr);
- break;
- case any_mode(make_box_cmd):
- begin_box(0);
- break;
- case any_mode(assign_box_dir_cmd):
- scan_register_num();
- cur_box = box(cur_val);
- scan_optional_equals();
- scan_direction();
- if (cur_box != null)
- box_dir(cur_box) = cur_val;
- break;
+@ |stop| is the second special case. We want |main_control| to return to its caller
+if there is nothing left to do.
- case vmode + start_par_cmd:
- /* There is a really small patch to add a new primitive called
- \.{\\quitvmode}. In vertical modes, it is identical to \.{\\indent},
- but in horizontal and math modes it is really a no-op (as opposed to
- \.{\\indent}, which executes the |indent_in_hmode| procedure).
- */
- /* A paragraph begins when horizontal-mode material occurs in vertical mode,
- or when the paragraph is explicitly started by `\.{\\quitvmode}',
- `\.{\\indent}' or `\.{\\noindent}'.
- */
- new_graf((cur_chr > 0));
- break;
- case hmode + start_par_cmd:
- case mmode + start_par_cmd:
- if (cur_chr != 2)
- indent_in_hmode();
- break;
- case vmode + letter_cmd:
- case vmode + other_char_cmd:
- case vmode + char_num_cmd:
- case vmode + char_given_cmd:
- case vmode + char_ghost_cmd:
- case vmode + math_shift_cmd:
- case vmode + math_shift_cs_cmd:
- case vmode + un_hbox_cmd:
- case vmode + vrule_cmd:
- case vmode + accent_cmd:
- case vmode + discretionary_cmd:
- case vmode + hskip_cmd:
- case vmode + valign_cmd:
- case vmode + ex_space_cmd:
- case vmode + no_boundary_cmd:
- back_input();
- new_graf(true);
- break;
+@c
+static void run_stop (void) {
+ if (its_all_over())
+ main_control_state= goto_return; /* this is the only way out */
+}
- case vmode + par_end_cmd:
- /* A paragraph ends when a |par_end| command is sensed, or when we are in
- horizontal mode when reaching the right brace of vertical-mode routines
- like \.{\\vbox}, \.{\\insert}, or \.{\\output}. */
- normal_paragraph();
- if (mode > 0) {
- check_filter("vmode_par");
- build_page();
- }
- break;
- case hmode + par_end_cmd:
- if (align_state < 0)
- off_save(); /* this tries to recover from an alignment that didn't end properly */
- end_graf(bottom_level); /* this takes us to the enclosing mode, if |mode>0| */
- if (mode == vmode) {
- check_filter("hmode_par");
- build_page();
- }
- break;
- case hmode + stop_cmd:
- case hmode + vskip_cmd:
- case hmode + hrule_cmd:
- case hmode + un_vbox_cmd:
- case hmode + halign_cmd:
- head_for_vmode();
- break;
- case any_mode(insert_cmd):
- case hmode + vadjust_cmd:
- case mmode + vadjust_cmd:
- /* Insertion and adjustment and mark nodes are constructed by the following
- pieces of the program. */
- begin_insert_or_adjust();
- break;
- case any_mode(mark_cmd):
- handle_mark();
- break;
- case any_mode(break_penalty_cmd):
- /* Penalty nodes get into a list via the |break_penalty| command. */
- append_penalty();
- break;
- case any_mode(remove_item_cmd):
- /* The |remove_item| command removes a penalty, kern, or glue node if it
- appears at the tail of the current list, using a brute-force linear scan.
- Like \.{\\lastbox}, this command is not allowed in vertical mode (except
- internal vertical mode), since the current list in vertical mode is sent
- to the page builder. But if we happen to be able to implement it in
- vertical mode, we do. */
- delete_last();
- break;
- case vmode + un_vbox_cmd:
- case hmode + un_hbox_cmd:
- case mmode + un_hbox_cmd:
- /* The |un_hbox| and |un_vbox| commands unwrap one of the |number_regs|
- current boxes. */
- unpackage();
- break;
- case hmode + ital_corr_cmd:
- /* Italic corrections are converted to kern nodes when the |ital_corr| command
- follows a character. In math mode the same effect is achieved by appending
- a kern of zero here, since italic corrections are supplied later. */
- append_italic_correction();
- break;
- case mmode + ital_corr_cmd:
- tail_append(new_kern(0));
- break;
- case hmode + discretionary_cmd:
- case mmode + discretionary_cmd:
- append_discretionary();
- break;
- case any_mode(assign_local_box_cmd):
- append_local_box(cur_chr);
- break;
- case hmode + accent_cmd:
- /* We need only one more thing to complete the horizontal mode routines, namely
- the \.{\\accent} primitive. */
- make_accent();
- break;
- case any_mode(car_ret_cmd):
- case any_mode(tab_mark_cmd):
- align_error();
- break;
- case any_mode(no_align_cmd):
- no_align_error();
- break;
- case any_mode(omit_cmd):
- omit_error();
- break;
- case vmode + halign_cmd:
- case hmode + valign_cmd:
- init_align();
- break;
- case mmode + halign_cmd:
- if (privileged()) {
- if (cur_group == math_shift_group)
- init_align();
- else
- off_save();
- }
- break;
- case vmode + endv_cmd:
- case hmode + endv_cmd:
- do_endv();
- break;
- case any_mode(end_cs_name_cmd):
- cs_error();
- break;
- case hmode + math_shift_cmd:
- case hmode + math_shift_cs_cmd:
- init_math();
- break;
- case mmode + eq_no_cmd:
- if (privileged()) {
- if (cur_group == math_shift_group)
- start_eq_no();
- else
- off_save();
- }
- break;
- case mmode + left_brace_cmd:
- math_left_brace();
- break;
- case mmode + letter_cmd:
- case mmode + other_char_cmd:
- case mmode + char_given_cmd:
- set_math_char(get_math_code(cur_chr));
- break;
- case mmode + char_num_cmd:
- scan_char_num();
- cur_chr = cur_val;
- set_math_char(get_math_code(cur_chr));
- break;
- case mmode + math_char_num_cmd:
- if (cur_chr == 0)
- mval = scan_mathchar(tex_mathcode);
- else if (cur_chr == 1)
- mval = scan_mathchar(aleph_mathcode);
- else if (cur_chr == 2)
- mval = scan_mathchar(xetex_mathcode);
- else
- mval = scan_mathchar(xetexnum_mathcode);
- set_math_char(mval);
- break;
- case mmode + math_given_cmd:
- mval = mathchar_from_integer(cur_chr, tex_mathcode);
- set_math_char(mval);
- break;
- case mmode + omath_given_cmd:
- mval = mathchar_from_integer(cur_chr, aleph_mathcode);
- set_math_char(mval);
- break;
- case mmode + xmath_given_cmd:
- mval = mathchar_from_integer(cur_chr, xetex_mathcode);
- set_math_char(mval);
- break;
- case mmode + delim_num_cmd:
- if (cur_chr == 0)
- mval = scan_delimiter_as_mathchar(tex_mathcode);
- else if (cur_chr == 1)
- mval = scan_delimiter_as_mathchar(aleph_mathcode);
- else
- mval = scan_delimiter_as_mathchar(xetex_mathcode);
- set_math_char(mval);
- break;
- case mmode + math_comp_cmd:
- math_math_comp();
- break;
- case mmode + limit_switch_cmd:
- math_limit_switch();
- break;
- case mmode + radical_cmd:
- math_radical();
- break;
- case mmode + accent_cmd:
- case mmode + math_accent_cmd:
- math_ac();
- break;
- case mmode + vcenter_cmd:
- scan_spec(vcenter_group);
- normal_paragraph();
- push_nest();
- mode = -vmode;
+@ @c
+static void run_non_math_math (void) {
+ back_input();
+ new_graf(true);
+}
+
+@ @c
+static void run_math_char_num (void) {
+ mathcodeval mval; /* to build up an argument to |set_math_char| */
+ if (cur_chr == 0)
+ mval = scan_mathchar(tex_mathcode);
+ else if (cur_chr == 1)
+ mval = scan_mathchar(aleph_mathcode);
+ else if (cur_chr == 2)
+ mval = scan_mathchar(xetex_mathcode);
+ else
+ mval = scan_mathchar(xetexnum_mathcode);
+ math_char_in_text(mval);
+}
+
+@ @c
+static void run_math_given (void) {
+ mathcodeval mval; /* to build up an argument to |set_math_char| */
+ mval = mathchar_from_integer(cur_chr, tex_mathcode);
+ math_char_in_text(mval);
+}
+
+static void run_omath_given (void) {
+ mathcodeval mval; /* to build up an argument to |set_math_char| */
+ mval = mathchar_from_integer(cur_chr, aleph_mathcode);
+ math_char_in_text(mval);
+}
+
+static void run_xmath_given (void) {
+ mathcodeval mval; /* to build up an argument to |set_math_char| */
+ mval = mathchar_from_integer(cur_chr, xetex_mathcode);
+ math_char_in_text(mval);
+}
+
+@ The most important parts of |main_control| are concerned with \TeX's
+chief mission of box-making. We need to control the activities that put
+entries on vlists and hlists, as well as the activities that convert
+those lists into boxes. All of the necessary machinery has already been
+developed; it remains for us to ``push the buttons'' at the right times.
+
+As an introduction to these routines, let's consider one of the simplest
+cases: What happens when `\.{\\hrule}' occurs in vertical mode, or
+`\.{\\vrule}' in horizontal mode or math mode? The code in |main_control|
+is short, since the |scan_rule_spec| routine already does most of what is
+required; thus, there is no need for a special action procedure.
+
+Note that baselineskip calculations are disabled after a rule in vertical
+mode, by setting |prev_depth:=pdf_ignored_dimen|.
+
+@c
+static void run_rule (void) {
+ tail_append(scan_rule_spec());
+ if (abs(mode) == vmode)
prev_depth = pdf_ignored_dimen;
- if (every_vbox != null)
- begin_token_list(every_vbox, every_vbox_text);
- break;
- case mmode + math_style_cmd:
- tail_append(new_style((small_number) cur_chr));
- break;
- case mmode + non_script_cmd:
- tail_append(new_glue(zero_glue));
- subtype(tail) = cond_math_glue;
- break;
- case mmode + math_choice_cmd:
- if (cur_chr == 0)
- append_choices();
+ else if (abs(mode) == hmode)
+ space_factor = 1000;
+}
+
+@
+Many of the actions related to box-making are triggered by the appearance
+of braces in the input. For example, when the user says `\.{\\hbox}
+\.{to} \.{100pt\{$\langle\,\hbox{hlist}\,\rangle$\}}' in vertical mode,
+the information about the box size (100pt, |exactly|) is put onto |save_stack|
+with a level boundary word just above it, and |cur_group:=adjusted_hbox_group|;
+\TeX\ enters restricted horizontal mode to process the hlist. The right
+brace eventually causes |save_stack| to be restored to its former state,
+at which time the information about the box size (100pt, |exactly|) is
+available once again; a box is packaged and we leave restricted horizontal
+mode, appending the new box to the current list of the enclosing mode
+(in this case to the current list of vertical mode), followed by any
+vertical adjustments that were removed from the box by |hpack|.
+
+The next few sections of the program are therefore concerned with the
+treatment of left and right curly braces.
+
+If a left brace occurs in the middle of a page or paragraph, it simply
+introduces a new level of grouping, and the matching right brace will not have
+such a drastic effect. Such grouping affects neither the mode nor the
+current list.
+
+@c
+static void run_left_brace (void) {
+ new_save_level(simple_group);
+ eq_word_define(int_base + no_local_whatsits_code, 0);
+ eq_word_define(int_base + no_local_dirs_code, 0);
+}
+
+static void run_begin_group (void) {
+ new_save_level(semi_simple_group);
+ eq_word_define(int_base + no_local_whatsits_code, 0);
+ eq_word_define(int_base + no_local_dirs_code, 0);
+}
+
+static void run_end_group (void) {
+ if (cur_group == semi_simple_group) {
+ fixup_directions();
+ } else {
+ off_save();
+ }
+}
+
+@ Constructions that require a box are started by calling |scan_box| with
+a specified context code. The |scan_box| routine verifies
+that a |make_box| command comes next and then it calls |begin_box|.
+
+@c
+static void run_move (void) {
+ int t = cur_chr;
+ scan_normal_dimen();
+ if (t == 0)
+ scan_box(cur_val);
+ else
+ scan_box(-cur_val);
+}
+
+@ @c
+static void run_leader_ship (void) {
+ scan_box(leader_flag - a_leaders + cur_chr);
+}
+
+@ @c
+static void run_make_box (void) {
+ begin_box(0);
+}
+
+@ @c
+static void run_box_dir (void) {
+ scan_register_num();
+ cur_box = box(cur_val);
+ scan_optional_equals();
+ scan_direction();
+ if (cur_box != null)
+ box_dir(cur_box) = cur_val;
+}
+
+@ There is a really small patch to add a new primitive called
+\.{\\quitvmode}. In vertical modes, it is identical to \.{\\indent},
+but in horizontal and math modes it is really a no-op (as opposed to
+\.{\\indent}, which executes the |indent_in_hmode| procedure).
+
+A paragraph begins when horizontal-mode material occurs in vertical mode,
+or when the paragraph is explicitly started by `\.{\\quitvmode}',
+`\.{\\indent}' or `\.{\\noindent}'.
+
+@c
+static void run_start_par_vmode (void) {
+ new_graf((cur_chr > 0));
+}
+
+@ @c
+static void run_start_par (void) {
+ if (cur_chr != 2)
+ indent_in_hmode();
+}
+
+@ @c
+static void run_new_graf (void) {
+ back_input();
+ new_graf(true);
+}
+
+@ A paragraph ends when a |par_end| command is sensed, or when we are in
+horizontal mode when reaching the right brace of vertical-mode routines
+like \.{\\vbox}, \.{\\insert}, or \.{\\output}.
+
+@c
+static void run_par_end_vmode (void) {
+ normal_paragraph();
+ if (mode > 0) {
+ check_filter("vmode_par");
+ build_page();
+ }
+}
+
+@ @c
+static void run_par_end_hmode (void) {
+ if (align_state < 0)
+ off_save(); /* this tries to recover from an alignment that didn't end properly */
+ end_graf(bottom_level); /* this takes us to the enclosing mode, if |mode>0| */
+ if (mode == vmode) {
+ check_filter("hmode_par");
+ build_page();
+ }
+}
+
+@ @c
+static void append_italic_correction_mmode (void) {
+ tail_append(new_kern(0));
+}
+
+@ @c
+static void run_local_box (void) {
+ append_local_box(cur_chr);
+}
+
+@ @c
+static void run_halign_mmode (void) {
+ if (privileged()) {
+ if (cur_group == math_shift_group)
+ init_align();
else
- setup_math_style();
- break;
- case mmode + above_cmd:
- math_fraction();
- break;
- case mmode + sub_mark_cmd:
- case mmode + sup_mark_cmd:
- case mmode + super_sub_script_cmd:
- sub_sup();
- break;
- case mmode + left_right_cmd:
- math_left_right();
- break;
- case mmode + math_shift_cmd:
- case mmode + math_shift_cs_cmd:
+ off_save();
+ }
+}
+
+@ @c
+static void run_eq_no (void) {
+ if (privileged()) {
if (cur_group == math_shift_group)
- after_math();
+ start_eq_no();
else
off_save();
- break;
+ }
+}
- /* Cases of |main_control| that do not depend on |mode| */
- /*
- The long |main_control| procedure has now been fully specified, except for
- certain activities that are independent of the current mode. These activities
- do not change the current vlist or hlist or mlist; if they change anything,
- it is the value of a parameter or the meaning of a control sequence.
- */
- case any_mode(toks_register_cmd):
- case any_mode(assign_toks_cmd):
- case any_mode(assign_int_cmd):
- case any_mode(assign_attr_cmd):
- case any_mode(assign_dir_cmd):
- case any_mode(assign_dimen_cmd):
- case any_mode(assign_glue_cmd):
- case any_mode(assign_mu_glue_cmd):
- case any_mode(assign_font_dimen_cmd):
- case any_mode(assign_font_int_cmd):
- case any_mode(set_aux_cmd):
- case any_mode(set_prev_graf_cmd):
- case any_mode(set_page_dimen_cmd):
- case any_mode(set_page_int_cmd):
- case any_mode(set_box_dimen_cmd):
- case any_mode(set_tex_shape_cmd):
- case any_mode(set_etex_shape_cmd):
- case any_mode(def_char_code_cmd):
- case any_mode(def_del_code_cmd):
- case any_mode(extdef_math_code_cmd):
- case any_mode(extdef_del_code_cmd):
- case any_mode(def_family_cmd):
- case any_mode(set_math_param_cmd):
- case any_mode(set_font_cmd):
- case any_mode(def_font_cmd):
- case any_mode(letterspace_font_cmd):
- case any_mode(pdf_copy_font_cmd):
- case any_mode(register_cmd):
- case any_mode(advance_cmd):
- case any_mode(multiply_cmd):
- case any_mode(divide_cmd):
- case any_mode(prefix_cmd):
- case any_mode(let_cmd):
- case any_mode(shorthand_def_cmd):
- case any_mode(read_to_cs_cmd):
- case any_mode(def_cmd):
- case any_mode(set_box_cmd):
- case any_mode(hyph_data_cmd):
- case any_mode(set_interaction_cmd):
- case any_mode(set_ocp_cmd):
- case any_mode(def_ocp_cmd):
- case any_mode(set_ocp_list_cmd):
- case any_mode(def_ocp_list_cmd):
- case any_mode(clear_ocp_lists_cmd):
- case any_mode(push_ocp_list_cmd):
- case any_mode(pop_ocp_list_cmd):
- case any_mode(ocp_list_op_cmd):
- case any_mode(ocp_trace_level_cmd):
- prefixed_command();
- break;
- case any_mode(after_assignment_cmd):
- get_token();
- after_token = cur_tok;
- break;
- case any_mode(after_group_cmd):
- get_token();
- save_for_after(cur_tok);
- break;
- case any_mode(in_stream_cmd):
- open_or_close_in();
- break;
- case any_mode(message_cmd):
- issue_message();
- break;
- case any_mode(case_shift_cmd):
- shift_case();
- break;
- case any_mode(xray_cmd):
- show_whatever();
- break;
+@ @c
+static void run_letter_mmode (void) {
+ set_math_char(get_math_code(cur_chr));
+}
- /* Cases of |main_control| that are for extensions to \TeX */
- case any_mode(extension_cmd):
- do_extension(static_pdf);
- break;
- } /* end of the big |switch| statement */
+@ @c
+static void run_char_num_mmode (void) {
+ scan_char_num();
+ cur_chr = cur_val;
+ set_math_char(get_math_code(cur_chr));
+}
+
+@ @c
+static void run_math_char_num_mmode (void) {
+ mathcodeval mval; /* to build up an argument to |set_math_char| */
+ if (cur_chr == 0)
+ mval = scan_mathchar(tex_mathcode);
+ else if (cur_chr == 1)
+ mval = scan_mathchar(aleph_mathcode);
+ else if (cur_chr == 2)
+ mval = scan_mathchar(xetex_mathcode);
+ else
+ mval = scan_mathchar(xetexnum_mathcode);
+ set_math_char(mval);
+}
+
+@ @c
+static void run_math_given_mmode (void) {
+ mathcodeval mval; /* to build up an argument to |set_math_char| */
+ mval = mathchar_from_integer(cur_chr, tex_mathcode);
+ set_math_char(mval);
+}
+
+static void run_omath_given_mmode (void) {
+ mathcodeval mval; /* to build up an argument to |set_math_char| */
+ mval = mathchar_from_integer(cur_chr, aleph_mathcode);
+ set_math_char(mval);
+}
+
+static void run_xmath_given_mmode (void) {
+ mathcodeval mval; /* to build up an argument to |set_math_char| */
+ mval = mathchar_from_integer(cur_chr, xetex_mathcode);
+ set_math_char(mval);
+}
+
+@ @c
+static void run_delim_num (void) {
+ mathcodeval mval; /* to build up an argument to |set_math_char| */
+ if (cur_chr == 0)
+ mval = scan_delimiter_as_mathchar(tex_mathcode);
+ else if (cur_chr == 1)
+ mval = scan_delimiter_as_mathchar(aleph_mathcode);
+ else
+ mval = scan_delimiter_as_mathchar(xetex_mathcode);
+ set_math_char(mval);
+
+}
+
+@ @c
+static void run_vcenter (void) {
+ scan_spec(vcenter_group);
+ normal_paragraph();
+ push_nest();
+ mode = -vmode;
+ prev_depth = pdf_ignored_dimen;
+ if (every_vbox != null)
+ begin_token_list(every_vbox, every_vbox_text);
+}
+
+@ @c
+static void run_math_style (void) {
+ tail_append(new_style((small_number) cur_chr));
+}
+
+@ @c
+static void run_non_script (void) {
+ tail_append(new_glue(zero_glue));
+ subtype(tail) = cond_math_glue;
+}
+
+@ @c
+static void run_math_choice (void) {
+ if (cur_chr == 0)
+ append_choices();
+ else
+ setup_math_style();
+}
+
+@ @c
+static void run_math_shift (void) {
+ if (cur_group == math_shift_group)
+ after_math();
+ else
+ off_save();
+}
+
+@ @c
+static void run_after_assignment (void) {
+ get_token();
+ after_token = cur_tok;
+}
+
+@ @c
+static void run_after_group (void) {
+ get_token();
+ save_for_after(cur_tok);
+}
+
+@ @c
+static void run_extension (void) {
+ do_extension(static_pdf);
+}
+
+
+@ For mode-independent commands, the following macro is useful.
+
+Also, there is a list of cases where the user has probably gotten into or out of math
+mode by mistake. \TeX\ will insert a dollar sign and rescan the current token, and
+it makes sense ot have a macro for that as well.
- goto BIG_SWITCH; /* restart */
+@c
+#define any_mode(A,B) jump_table[vmode+(A)]=B; jump_table[hmode+(A)]=B; jump_table[mmode+(A)]=B
+#define non_math(A,B) jump_table[vmode+(A)]=B; jump_table[hmode+(A)]=B;
+
+
+@ The |main_control| uses a jump table, and |init_main_control| sets that table up.
+@c
+typedef void (*main_control_function) (void);
+main_control_function *jump_table;
+
+static void init_main_control (void) {
+ jump_table = xmalloc((mmode+max_command_cmd+1) * sizeof(main_control_function)) ;
+
+ jump_table[hmode + char_num_cmd] = run_char_num;
+ jump_table[hmode + letter_cmd] = run_char;
+ jump_table[hmode + other_char_cmd] = run_char;
+ jump_table[hmode + char_given_cmd] = run_char;
+ jump_table[hmode + spacer_cmd] = run_app_space;
+ jump_table[hmode + ex_space_cmd] = run_app_space;
+ jump_table[mmode + ex_space_cmd] = run_app_space;
+ jump_table[hmode + no_boundary_cmd] = run_no_boundary;
+ jump_table[hmode + char_ghost_cmd] = run_char_ghost;
+ jump_table[mmode + char_ghost_cmd] = run_char_ghost;
+ any_mode(relax_cmd, run_relax);
+ jump_table[vmode + spacer_cmd] = run_relax;
+ jump_table[mmode + spacer_cmd] = run_relax;
+ jump_table[mmode + no_boundary_cmd] = run_relax;
+ any_mode(ignore_spaces_cmd,run_ignore_spaces);
+ jump_table[vmode + stop_cmd] = run_stop;
+ jump_table[vmode + math_char_num_cmd] = run_non_math_math;
+ jump_table[vmode + math_given_cmd] = run_non_math_math;
+ jump_table[vmode + omath_given_cmd] = run_non_math_math;
+ jump_table[vmode + xmath_given_cmd] = run_non_math_math;
+ jump_table[hmode + math_char_num_cmd] = run_math_char_num;
+ jump_table[hmode + math_given_cmd] = run_math_given;
+ jump_table[hmode + omath_given_cmd] = run_omath_given;
+ jump_table[hmode + xmath_given_cmd] = run_xmath_given;
+
+ jump_table[vmode + vmove_cmd] = report_illegal_case;
+ jump_table[hmode + hmove_cmd] = report_illegal_case;
+ jump_table[mmode + hmove_cmd] = report_illegal_case;
+ any_mode(last_item_cmd, report_illegal_case);
+ jump_table[vmode + vadjust_cmd] = report_illegal_case;
+ jump_table[vmode + ital_corr_cmd] = report_illegal_case;
+ non_math(eq_no_cmd,report_illegal_case);
+ any_mode(mac_param_cmd,report_illegal_case);
+
+ non_math(sup_mark_cmd, insert_dollar_sign);
+ non_math(sub_mark_cmd, insert_dollar_sign);
+ non_math(super_sub_script_cmd, insert_dollar_sign);
+ non_math(math_comp_cmd, insert_dollar_sign);
+ non_math(delim_num_cmd, insert_dollar_sign);
+ non_math(left_right_cmd, insert_dollar_sign);
+ non_math(above_cmd, insert_dollar_sign);
+ non_math(radical_cmd, insert_dollar_sign);
+ non_math(math_style_cmd, insert_dollar_sign);
+ non_math(math_choice_cmd, insert_dollar_sign);
+ non_math(vcenter_cmd, insert_dollar_sign);
+ non_math(non_script_cmd, insert_dollar_sign);
+ non_math(mkern_cmd, insert_dollar_sign);
+ non_math(limit_switch_cmd, insert_dollar_sign);
+ non_math(mskip_cmd, insert_dollar_sign);
+ non_math(math_accent_cmd, insert_dollar_sign);
+ jump_table[mmode + endv_cmd] = insert_dollar_sign;
+ jump_table[mmode + par_end_cmd] = insert_dollar_sign;
+ jump_table[mmode + stop_cmd] = insert_dollar_sign;
+ jump_table[mmode + vskip_cmd] = insert_dollar_sign;
+ jump_table[mmode + un_vbox_cmd] = insert_dollar_sign;
+ jump_table[mmode + valign_cmd] = insert_dollar_sign;
+ jump_table[mmode + hrule_cmd] = insert_dollar_sign;
+ jump_table[vmode + hrule_cmd] = run_rule;
+ jump_table[hmode + vrule_cmd] = run_rule;
+ jump_table[mmode + vrule_cmd] = run_rule;
+ jump_table[vmode + vskip_cmd] = append_glue;
+ jump_table[hmode + hskip_cmd] = append_glue;
+ jump_table[mmode + hskip_cmd] = append_glue;
+ jump_table[mmode + mskip_cmd] = append_glue;
+ any_mode(kern_cmd, append_kern);
+ jump_table[mmode + mkern_cmd] = append_kern;
+ non_math(left_brace_cmd, run_left_brace);
+ any_mode(begin_group_cmd,run_begin_group);
+ any_mode(end_group_cmd, run_end_group);
+ any_mode(right_brace_cmd, handle_right_brace);
+ jump_table[vmode + hmove_cmd] = run_move;
+ jump_table[hmode + vmove_cmd] = run_move;
+ jump_table[mmode + vmove_cmd] = run_move;
+ any_mode(leader_ship_cmd, run_leader_ship);
+ any_mode(make_box_cmd, run_make_box);
+ any_mode(assign_box_dir_cmd, run_box_dir);
+ jump_table[vmode + start_par_cmd] = run_start_par_vmode;
+ jump_table[hmode + start_par_cmd] = run_start_par;
+ jump_table[mmode + start_par_cmd] = run_start_par;
+ jump_table[vmode + letter_cmd] = run_new_graf;
+ jump_table[vmode + other_char_cmd] = run_new_graf;
+ jump_table[vmode + char_num_cmd] = run_new_graf;
+ jump_table[vmode + char_given_cmd] = run_new_graf;
+ jump_table[vmode + char_ghost_cmd] = run_new_graf;
+ jump_table[vmode + math_shift_cmd] = run_new_graf;
+ jump_table[vmode + math_shift_cs_cmd] = run_new_graf;
+ jump_table[vmode + un_hbox_cmd] = run_new_graf;
+ jump_table[vmode + vrule_cmd] = run_new_graf;
+ jump_table[vmode + accent_cmd] = run_new_graf;
+ jump_table[vmode + discretionary_cmd] = run_new_graf;
+ jump_table[vmode + hskip_cmd] = run_new_graf;
+ jump_table[vmode + valign_cmd] = run_new_graf;
+ jump_table[vmode + ex_space_cmd] = run_new_graf;
+ jump_table[vmode + no_boundary_cmd] = run_new_graf;
+ jump_table[vmode + par_end_cmd] = run_par_end_vmode;
+ jump_table[hmode + par_end_cmd] = run_par_end_hmode;
+ jump_table[hmode + stop_cmd] = head_for_vmode;
+ jump_table[hmode + vskip_cmd] = head_for_vmode;
+ jump_table[hmode + hrule_cmd] = head_for_vmode;
+ jump_table[hmode + un_vbox_cmd] = head_for_vmode;
+ jump_table[hmode + halign_cmd] = head_for_vmode;
+ any_mode(insert_cmd,begin_insert_or_adjust);
+ jump_table[hmode + vadjust_cmd] = begin_insert_or_adjust;
+ jump_table[mmode + vadjust_cmd] = begin_insert_or_adjust;
+ any_mode(mark_cmd, handle_mark);
+ any_mode(break_penalty_cmd, append_penalty);
+ any_mode(remove_item_cmd, delete_last);
+ jump_table[vmode + un_vbox_cmd] = unpackage;
+ jump_table[hmode + un_hbox_cmd] = unpackage;
+ jump_table[mmode + un_hbox_cmd] = unpackage;
+ jump_table[hmode + ital_corr_cmd] = append_italic_correction;
+ jump_table[mmode + ital_corr_cmd] = append_italic_correction_mmode;
+ jump_table[hmode + discretionary_cmd] = append_discretionary;
+ jump_table[mmode + discretionary_cmd] = append_discretionary;
+ any_mode(assign_local_box_cmd, run_local_box);
+ jump_table[hmode + accent_cmd] = make_accent;
+ any_mode(car_ret_cmd,align_error);
+ any_mode(tab_mark_cmd,align_error);
+ any_mode(no_align_cmd,no_align_error);
+ any_mode(omit_cmd, omit_error);
+ jump_table[vmode + halign_cmd] = init_align;
+ jump_table[hmode + valign_cmd] = init_align;
+ jump_table[mmode + halign_cmd] = run_halign_mmode;
+ jump_table[vmode + endv_cmd] = do_endv;
+ jump_table[hmode + endv_cmd] = do_endv;
+ any_mode(end_cs_name_cmd, cs_error);
+ jump_table[hmode + math_shift_cmd] = init_math;
+ jump_table[hmode + math_shift_cs_cmd] = init_math;
+ jump_table[mmode + eq_no_cmd] = run_eq_no;
+ jump_table[mmode + left_brace_cmd] = math_left_brace;
+ jump_table[mmode + letter_cmd] = run_letter_mmode;
+ jump_table[mmode + other_char_cmd] = run_letter_mmode;
+ jump_table[mmode + char_given_cmd] = run_letter_mmode;
+ jump_table[mmode + char_num_cmd] = run_char_num_mmode;
+ jump_table[mmode + math_char_num_cmd] = run_math_char_num_mmode;
+ jump_table[mmode + math_given_cmd] = run_math_given_mmode;
+ jump_table[mmode + omath_given_cmd] = run_omath_given_mmode;
+ jump_table[mmode + xmath_given_cmd] = run_xmath_given_mmode;
+ jump_table[mmode + delim_num_cmd] = run_delim_num;
+ jump_table[mmode + math_comp_cmd] = math_math_comp;
+ jump_table[mmode + limit_switch_cmd] = math_limit_switch;
+ jump_table[mmode + radical_cmd] = math_radical;
+ jump_table[mmode + accent_cmd] = math_ac;
+ jump_table[mmode + math_accent_cmd] = math_ac;
+ jump_table[mmode + vcenter_cmd] = run_vcenter;
+ jump_table[mmode + math_style_cmd] = run_math_style;
+ jump_table[mmode + non_script_cmd] = run_non_script;
+ jump_table[mmode + math_choice_cmd] = run_math_choice;
+ jump_table[mmode + above_cmd] = math_fraction;
+ jump_table[mmode + sub_mark_cmd] = sub_sup;
+ jump_table[mmode + sup_mark_cmd] = sub_sup;
+ jump_table[mmode + super_sub_script_cmd] = sub_sup;
+ jump_table[mmode + left_right_cmd] = math_left_right;
+ jump_table[mmode + math_shift_cmd] = run_math_shift;
+ jump_table[mmode + math_shift_cs_cmd] = run_math_shift;
+ any_mode(toks_register_cmd, prefixed_command);
+ any_mode(assign_toks_cmd, prefixed_command);
+ any_mode(assign_int_cmd, prefixed_command);
+ any_mode(assign_attr_cmd, prefixed_command);
+ any_mode(assign_dir_cmd, prefixed_command);
+ any_mode(assign_dimen_cmd, prefixed_command);
+ any_mode(assign_glue_cmd, prefixed_command);
+ any_mode(assign_mu_glue_cmd, prefixed_command);
+ any_mode(assign_font_dimen_cmd, prefixed_command);
+ any_mode(assign_font_int_cmd, prefixed_command);
+ any_mode(set_aux_cmd, prefixed_command);
+ any_mode(set_prev_graf_cmd, prefixed_command);
+ any_mode(set_page_dimen_cmd, prefixed_command);
+ any_mode(set_page_int_cmd, prefixed_command);
+ any_mode(set_box_dimen_cmd, prefixed_command);
+ any_mode(set_tex_shape_cmd, prefixed_command);
+ any_mode(set_etex_shape_cmd, prefixed_command);
+ any_mode(def_char_code_cmd, prefixed_command);
+ any_mode(def_del_code_cmd, prefixed_command);
+ any_mode(extdef_math_code_cmd, prefixed_command);
+ any_mode(extdef_del_code_cmd, prefixed_command);
+ any_mode(def_family_cmd, prefixed_command);
+ any_mode(set_math_param_cmd, prefixed_command);
+ any_mode(set_font_cmd, prefixed_command);
+ any_mode(def_font_cmd, prefixed_command);
+ any_mode(letterspace_font_cmd, prefixed_command);
+ any_mode(pdf_copy_font_cmd, prefixed_command);
+ any_mode(register_cmd, prefixed_command);
+ any_mode(advance_cmd, prefixed_command);
+ any_mode(multiply_cmd, prefixed_command);
+ any_mode(divide_cmd, prefixed_command);
+ any_mode(prefix_cmd, prefixed_command);
+ any_mode(let_cmd, prefixed_command);
+ any_mode(shorthand_def_cmd, prefixed_command);
+ any_mode(read_to_cs_cmd, prefixed_command);
+ any_mode(def_cmd, prefixed_command);
+ any_mode(set_box_cmd, prefixed_command);
+ any_mode(hyph_data_cmd, prefixed_command);
+ any_mode(set_interaction_cmd, prefixed_command);
+ any_mode(after_assignment_cmd,run_after_assignment);
+ any_mode(after_group_cmd,run_after_group);
+ any_mode(in_stream_cmd,open_or_close_in);
+ any_mode(message_cmd,issue_message);
+ any_mode(case_shift_cmd, shift_case);
+ any_mode(xray_cmd, show_whatever);
+ any_mode(extension_cmd, run_extension);
+}
+
+@ And here is |main_control| itself. It is quite short nowadays.
+
+@c
+void main_control(void)
+{
+ main_control_state = goto_next;
+ init_main_control () ;
+
+ if (equiv(every_job_loc) != null)
+ begin_token_list(equiv(every_job_loc), every_job_text);
+
+ while (1) {
+ if (main_control_state == goto_skip_token)
+ main_control_state = goto_next; /* reset */
+ else
+ get_x_token();
+
+ /* Give diagnostic information, if requested */
+ /* When a new token has just been fetched at |big_switch|, we have an
+ ideal place to monitor \TeX's activity. */
+ if (interrupt != 0 && OK_to_interrupt) {
+ back_input();
+ check_interrupt();
+ continue;
+ }
+ if (int_par(tracing_commands_code) > 0)
+ show_cur_cmd_chr();
+
+ (jump_table[(abs(mode) + cur_cmd)])(); /* run the command */
+
+ if (main_control_state == goto_return) {
+ return;
+ }
+ }
+ return; /* not reached */
}
@ @c
@@ -941,6 +962,18 @@ void you_cant(void)
print_in_mode(mode);
}
+@
+When erroneous situations arise, \TeX\ usually issues an error message
+specific to the particular error. For example, `\.{\\noalign}' should
+not appear in any mode, since it is recognized by the |align_peek| routine
+in all of its legitimate appearances; a special error message is given
+when `\.{\\noalign}' occurs elsewhere. But sometimes the most appropriate
+error message is simply that the user is not allowed to do what he or she
+has attempted. For example, `\.{\\moveleft}' is allowed only in vertical mode,
+and `\.{\\lower}' only in non-vertical modes. Such cases are enumerated
+here and in the other sections referred to under `See also \dots.'
+
+@c
void report_illegal_case(void)
{
you_cant();
@@ -1324,7 +1357,7 @@ void box_end(int box_context)
space_factor = 1000;
else
cur_box = new_sub_box(cur_box);
- vlink(tail) = cur_box;
+ couple_nodes(tail, cur_box);
tail = cur_box;
}
}
@@ -1362,7 +1395,7 @@ void box_end(int box_context)
}
} else
- ship_out(static_pdf, cur_box, true);
+ ship_out(static_pdf, cur_box, SHIPPING_PAGE);
}
}
@@ -1410,6 +1443,7 @@ void new_graf(boolean indented)
p = new_null_box();
box_dir(p) = par_direction;
width(p) = par_indent;
+ subtype(p) = HLIST_SUBTYPE_INDENT;
q = tail;
tail_append(p);
} else {
@@ -1419,8 +1453,8 @@ void new_graf(boolean indented)
while (dir_rover != null) {
if ((vlink(dir_rover) != null) || (dir_dir(dir_rover) != par_direction)) {
dir_graf_tmp = new_dir(dir_dir(dir_rover));
- vlink(dir_graf_tmp) = vlink(q);
- vlink(q) = dir_graf_tmp;
+ try_couple_nodes(dir_graf_tmp,vlink(q));
+ couple_nodes(q,dir_graf_tmp);
}
dir_rover = vlink(dir_rover);
}
@@ -1578,6 +1612,13 @@ void append_penalty(void)
@ When |delete_last| is called, |cur_chr| is the |type| of node that
will be deleted, if present.
+The |remove_item| command removes a penalty, kern, or glue node if it
+appears at the tail of the current list, using a brute-force linear scan.
+Like \.{\\lastbox}, this command is not allowed in vertical mode (except
+internal vertical mode), since the current list in vertical mode is sent
+to the page builder. But if we happen to be able to implement it in
+vertical mode, we do.
+
@c
void delete_last(void)
{
@@ -1635,7 +1676,7 @@ void unpackage(void)
halfword s; /* for varmem assignment */
if (cur_chr > copy_code) {
/* Handle saved items and |goto done| */
- vlink(tail) = disc_ptr[cur_chr];
+ try_couple_nodes(tail, disc_ptr[cur_chr]);
disc_ptr[cur_chr] = null;
goto DONE;
}
@@ -1656,9 +1697,9 @@ void unpackage(void)
}
if (c == copy_code) {
s = copy_node_list(list_ptr(p));
- vlink(tail) = s;
+ try_couple_nodes(tail,s);
} else {
- vlink(tail) = list_ptr(p);
+ try_couple_nodes(tail,list_ptr(p));
box(cur_val) = null;
list_ptr(p) = null;
flush_node(p);
@@ -1667,14 +1708,19 @@ void unpackage(void)
while (vlink(tail) != null) {
r = vlink(tail);
if (!is_char_node(r) && (type(r) == margin_kern_node)) {
- vlink(tail) = vlink(r);
+ try_couple_nodes(tail,vlink(r));
flush_node(r);
}
tail = vlink(tail);
}
}
-@ @c
+@
+Italic corrections are converted to kern nodes when the |ital_corr| command
+follows a character. In math mode the same effect is achieved by appending
+a kern of zero here, since italic corrections are supplied later.
+
+@c
void append_italic_correction(void)
{
halfword p; /* |char_node| at the tail of the current list */
@@ -2662,40 +2708,6 @@ void prefixed_command(void)
case set_interaction_cmd:
new_interaction();
break;
- case set_ocp_cmd:
- print_err("To use ocps, use the \\pushocplist primitive");
- print_ln();
- break;
- case def_ocp_cmd:
- new_ocp((small_number) a);
- break;
- case set_ocp_list_cmd:
- print_err("To use ocp lists, use the \\pushocplist primitive");
- print_ln();
- break;
- case def_ocp_list_cmd:
- new_ocp_list((small_number) a);
- break;
- case push_ocp_list_cmd:
- do_push_ocp_list((small_number) a);
- break;
- case pop_ocp_list_cmd:
- do_pop_ocp_list((small_number) a);
- break;
- case clear_ocp_lists_cmd:
- do_clear_ocp_lists((small_number) a);
- break;
- case ocp_list_op_cmd:
- print_err("To build ocp lists, use the \\ocplist primitive");
- print_ln();
- break;
- case ocp_trace_level_cmd:
- scan_optional_equals();
- scan_int();
- if (cur_val != 0)
- cur_val = 1;
- define(ocp_trace_level_base, data_cmd, cur_val);
- break;
default:
confusion("prefix");
break;
@@ -2854,7 +2866,7 @@ void assign_internal_value(int a, halfword p, int cur_val)
no_local_whatsits + 1);
}
- } else if ((p >= dimen_base) && (p < eqtb_size)) {
+ } else if ((p >= dimen_base) && (p <= eqtb_size)) {
if (p == (dimen_base + page_left_offset_code)) {
n = cur_val - one_true_inch;
word_define(dimen_base + h_offset_code, n);
@@ -3582,8 +3594,6 @@ void initialize(void)
cs_text(frozen_primitive) = maketexstring("primitive");
create_null_font();
font_bytes = 0;
- init_null_ocp(get_nullstr(), maketexstring("nullocp"));
- initialize_init_ocplists();
pdf_h_origin = one_inch;
pdf_v_origin = one_inch;
pdf_compress_level = 9;
diff --git a/Build/source/texk/web2c/luatexdir/tex/mathcodes.w b/Build/source/texk/web2c/luatexdir/tex/mathcodes.w
index 0850cbe2776..8b9ff0d8a11 100644
--- a/Build/source/texk/web2c/luatexdir/tex/mathcodes.w
+++ b/Build/source/texk/web2c/luatexdir/tex/mathcodes.w
@@ -21,8 +21,8 @@
#include "ptexlib.h"
static const char _svn_version[] =
- "$Id: mathcodes.w 3612 2010-04-13 09:29:42Z taco $ "
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/mathcodes.w $";
+ "$Id: mathcodes.w 3992 2010-11-28 08:24:21Z taco $ "
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/mathcodes.w $";
@ math codes
@c
@@ -97,9 +97,18 @@ void show_mathcode_value(mathcodeval c)
print_int(m);
} else {
print_char('"');
- print_hex_digit(c.class_value);
- print_hex_digit(c.family_value);
- two_hex(c.character_value);
+ if (c.class_value) {
+ print_hex_digit(c.class_value);
+ print_hex_digit(c.family_value);
+ two_hex(c.character_value);
+ } else if (c.family_value) {
+ print_hex_digit(c.family_value);
+ two_hex(c.character_value);
+ } else if (c.character_value >= 16) {
+ two_hex(c.character_value);
+ } else {
+ print_hex_digit(c.character_value);
+ }
}
}
diff --git a/Build/source/texk/web2c/luatexdir/tex/memoryword.w b/Build/source/texk/web2c/luatexdir/tex/memoryword.w
index 5c86ea12e6b..7338743ae79 100644
--- a/Build/source/texk/web2c/luatexdir/tex/memoryword.w
+++ b/Build/source/texk/web2c/luatexdir/tex/memoryword.w
@@ -22,7 +22,7 @@
static const char _svn_version[] =
"$Id: memoryword.w 3587 2010-04-03 14:32:25Z taco $"
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/memoryword.w $";
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/memoryword.w $";
@ When debugging, we may want to print a |memory_word| without knowing
diff --git a/Build/source/texk/web2c/luatexdir/tex/mlist.w b/Build/source/texk/web2c/luatexdir/tex/mlist.w
index c41c17392ea..5efcfac96b6 100644
--- a/Build/source/texk/web2c/luatexdir/tex/mlist.w
+++ b/Build/source/texk/web2c/luatexdir/tex/mlist.w
@@ -25,8 +25,8 @@
#include "lua/luatex-api.h"
static const char _svn_version[] =
- "$Id: mlist.w 3612 2010-04-13 09:29:42Z taco $ "
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/mlist.w $";
+ "$Id: mlist.w 3985 2010-11-26 15:08:32Z taco $ "
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/mlist.w $";
@ @c
#define delimiter_factor int_par(delimiter_factor_code)
@@ -1237,7 +1237,12 @@ static pointer get_delim_box(extinfo * ext, internal_font_number f, scaled v,
|(num_extenders*with_extenders)+num_normal|
*/
/* create an array of maximum shrinks and fill it */
- num_total = ((num_extenders * with_extenders) + num_normal);
+ if (with_extenders) {
+ num_total = ((num_extenders * with_extenders) + num_normal);
+ } else {
+ /* make sure we take at least the extenders that are needed to complete the built-up glyph */
+ num_total = (num_extenders + num_normal);
+ }
if (num_total == 1) {
/* weird, but could happen */
cc = ext->glyph;
@@ -1451,11 +1456,13 @@ static pointer do_var_delimiter(pointer d, int s, scaled v, scaled * ic,
int z; /* runs through font family members */
boolean large_attempt; /* are we trying the ``large'' variant? */
pointer att; /* to save the current attribute list */
+ boolean do_parts;
extinfo *ext;
att = null;
f = null_font;
c = 0;
w = 0;
+ do_parts = false;
large_attempt = false;
if (d == null)
goto FOUND;
@@ -1473,11 +1480,6 @@ static pointer do_var_delimiter(pointer d, int s, scaled v, scaled * ic,
CONTINUE:
i++;
if (char_exists(g, y)) {
- if (char_tag(g, y) == ext_tag) {
- f = g;
- c = y;
- goto FOUND;
- }
if (flat)
u = char_width(g, y);
else
@@ -1489,6 +1491,12 @@ static pointer do_var_delimiter(pointer d, int s, scaled v, scaled * ic,
if (u >= v)
goto FOUND;
}
+ if (char_tag(g, y) == ext_tag) {
+ f = g;
+ c = y;
+ do_parts = true;
+ goto FOUND;
+ }
if (i > 10000) {
/* endless loop */
endless_loop_error(g, y);
@@ -1514,11 +1522,11 @@ static pointer do_var_delimiter(pointer d, int s, scaled v, scaled * ic,
flush_node(d);
}
if (f != null_font) {
- /* When the following code is executed, |char_tag(q)| will be equal to
- |ext_tag| if and only if a built-up symbol is supposed to be returned.
+ /* When the following code is executed, |do_parts| will be true
+ if a built-up symbol is supposed to be returned.
*/
ext = NULL;
- if ((char_tag(f, c) == ext_tag) &&
+ if ((do_parts) &&
((!flat
&& (ext = get_charinfo_vert_variants(char_info(f, c))) != NULL)
|| (flat
@@ -2123,9 +2131,11 @@ respect to the size of the final box.
@c
#define TOP_CODE 1
#define BOT_CODE 2
+#define TOP_OR_BOT_MASK ((TOP_CODE) | (BOT_CODE))
+#define STRETCH_ACCENT_CODE 4
static void do_make_math_accent(pointer q, internal_font_number f, int c,
- int top_or_bot, int cur_style)
+ int flags, int cur_style)
{
pointer p, r, x, y; /* temporary registers for box construction */
scaled s; /* amount to skew the accent to the right */
@@ -2135,6 +2145,8 @@ static void do_make_math_accent(pointer q, internal_font_number f, int c,
boolean s_is_absolute; /* will be true if a top-accent is placed in |s| */
extinfo *ext;
pointer attr_p;
+ const int compat_mode = radical_rule(cur_style) == undefined_math_parameter;
+ const int top_or_bot = flags & TOP_OR_BOT_MASK;
attr_p = (top_or_bot == TOP_CODE ? accent_chr(q) : bot_accent_chr(q));
s_is_absolute = false;
c = cur_c;
@@ -2143,29 +2155,40 @@ static void do_make_math_accent(pointer q, internal_font_number f, int c,
s = 0;
if (type(nucleus(q)) == math_char_node) {
fetch(nucleus(q));
+ if (compat_mode) {
+ if (top_or_bot == TOP_CODE) {
+ s = get_kern(cur_f, cur_c, skew_char(cur_f));
+ } else {
+ s = 0;
+ }
+ } else {
if (top_or_bot == TOP_CODE) {
s = char_top_accent(cur_f, cur_c);
- if (s != 0) {
+ if (s != INT_MIN) {
s_is_absolute = true;
- } else {
- s = get_kern(cur_f, cur_c, skew_char(cur_f));
}
} else { /* new skewchar madness for bot accents */
s = char_bot_accent(cur_f, cur_c);
- if (s == 0) { /* better than nothing: */
+ if (s == INT_MIN) { /* better than nothing: */
s = char_top_accent(cur_f, cur_c);
}
- if (s != 0) {
+ if (s != INT_MIN) {
s_is_absolute = true;
}
}
+ }
}
x = clean_box(nucleus(q), cramped_style(cur_style), cur_style);
w = width(x);
h = height(x);
+ if (!compat_mode && !s_is_absolute && type(nucleus(q)) == math_char_node) {
+ s = half(w);
+ s_is_absolute = true;
+ }
/* Switch to a larger accent if available and appropriate */
y = null;
- while (1) {
+ if (flags & STRETCH_ACCENT_CODE) {
+ while (1) {
ext = NULL;
if ((char_tag(f, c) == ext_tag) &&
((ext = get_charinfo_hor_variants(char_info(f, c))) != NULL)) {
@@ -2184,6 +2207,7 @@ static void do_make_math_accent(pointer q, internal_font_number f, int c,
break;
c = yy;
}
+ }
}
if (y == null) {
y = char_box(f, c, node_attr(attr_p));
@@ -2220,12 +2244,16 @@ static void do_make_math_accent(pointer q, internal_font_number f, int c,
sa = char_top_accent(f, c);
else
sa = char_bot_accent(f, c);
- if (sa == 0) {
+ if (sa == INT_MIN) {
sa = half(width(y)); /* just take the center */
}
shift_amount(y) = s - sa;
} else {
- shift_amount(y) = s + half(w - width(y));
+ if (width(y)== 0) {
+ shift_amount(y) = s + w;
+ } else {
+ shift_amount(y) = s + half(w - width(y));
+ }
}
width(y) = 0;
if (top_or_bot == TOP_CODE) {
@@ -2264,10 +2292,13 @@ static void do_make_math_accent(pointer q, internal_font_number f, int c,
static void make_math_accent(pointer q, int cur_style)
{
+ int topstretch = !(subtype(q) % 2);
+ int botstretch = !(subtype(q) / 2);
+
if (accent_chr(q) != null) {
fetch(accent_chr(q));
if (char_exists(cur_f, cur_c)) {
- do_make_math_accent(q, cur_f, cur_c, TOP_CODE, cur_style);
+ do_make_math_accent(q, cur_f, cur_c, TOP_CODE | (topstretch ? STRETCH_ACCENT_CODE : 0), cur_style);
}
flush_node(accent_chr(q));
accent_chr(q) = null;
@@ -2275,7 +2306,7 @@ static void make_math_accent(pointer q, int cur_style)
if (bot_accent_chr(q) != null) {
fetch(bot_accent_chr(q));
if (char_exists(cur_f, cur_c)) {
- do_make_math_accent(q, cur_f, cur_c, BOT_CODE, cur_style);
+ do_make_math_accent(q, cur_f, cur_c, BOT_CODE | (botstretch ? STRETCH_ACCENT_CODE : 0), cur_style);
}
flush_node(bot_accent_chr(q));
bot_accent_chr(q) = null;
@@ -2432,6 +2463,7 @@ static scaled make_op(pointer q, int cur_style)
x = clean_box(nucleus(q), cur_style, cur_style);
if ((subscr(q) != null) && (subtype(q) != op_noad_type_limits))
width(x) = width(x) - delta; /* remove italic correction */
+
shift_amount(x) =
half(height(x) - depth(x)) - math_axis(cur_size);
/* center vertically */
@@ -2444,6 +2476,19 @@ static scaled make_op(pointer q, int cur_style)
x = clean_box(nucleus(q), cur_style, cur_style);
if ((subscr(q) != null) && (subtype(q) != op_noad_type_limits))
width(x) = width(x) - delta; /* remove italic correction */
+
+ /* For an OT MATH font, we may have to get rid of yet another italic
+ correction because |make_scripts()| will add one.
+ This test is somewhat more complicated because |x| can be a null
+ delimiter */
+ if ((subscr(q) != null || supscr(q) != null)
+ && (subtype(q) != op_noad_type_limits)
+ && ((list_ptr(x) != null)
+ && (type(list_ptr(x)) == glyph_node)
+ && is_new_mathfont(font(list_ptr(x))))) {
+ width(x) -= delta; /* remove another italic correction */
+ }
+
shift_amount(x) = half(height(x) - depth(x)) - math_axis(cur_size);
/* center vertically */
type(nucleus(q)) = sub_box_node;
@@ -3400,7 +3445,7 @@ static void mlist_to_hlist(pointer mlist, boolean penalties, int cur_style)
make_radical(q, cur_style);
break;
case accent_noad:
- make_math_accent(q, cur_style);
+ make_math_accent(q, cur_style);
break;
case style_node:
cur_style = subtype(q);
diff --git a/Build/source/texk/web2c/luatexdir/tex/nesting.w b/Build/source/texk/web2c/luatexdir/tex/nesting.w
index 332058a9451..8e9577b84e3 100644
--- a/Build/source/texk/web2c/luatexdir/tex/nesting.w
+++ b/Build/source/texk/web2c/luatexdir/tex/nesting.w
@@ -21,8 +21,8 @@
#include "ptexlib.h"
static const char _svn_version[] =
- "$Id: nesting.w 3612 2010-04-13 09:29:42Z taco $ "
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/nesting.w $";
+ "$Id: nesting.w 3615 2010-04-13 21:59:59Z oneiros $ "
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/nesting.w $";
@ these are for |show_activities|
diff --git a/Build/source/texk/web2c/luatexdir/tex/packaging.h b/Build/source/texk/web2c/luatexdir/tex/packaging.h
index af1f18a265f..c10a715695a 100644
--- a/Build/source/texk/web2c/luatexdir/tex/packaging.h
+++ b/Build/source/texk/web2c/luatexdir/tex/packaging.h
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: packaging.h 3261 2009-12-18 11:38:21Z taco $ */
+/* $Id: packaging.h 4044 2010-12-18 09:23:06Z taco $ */
#ifndef PACKAGING_H
# define PACKAGING_H
@@ -57,10 +57,12 @@ extern void do_subst_font(halfword p, int ex_ratio);
extern scaled char_pw(halfword p, int side);
extern halfword new_margin_kern(scaled w, halfword p, int side);
-# define update_adjust_list(A) do { \
- vlink(A) = adjust_ptr(p); \
- while (vlink(A) != null) \
- A = vlink(A); \
+# define update_adjust_list(A) do { \
+ if (A == null) \
+ pdf_error("pre vadjust", "adjust_tail or pre_adjust_tail is null"); \
+ vlink(A) = adjust_ptr(p); \
+ while (vlink(A) != null) \
+ A = vlink(A); \
} while (0)
extern halfword hpack(halfword p, scaled w, int m, int d);
diff --git a/Build/source/texk/web2c/luatexdir/tex/packaging.w b/Build/source/texk/web2c/luatexdir/tex/packaging.w
index 6813d61e85f..2de2d13f99d 100644
--- a/Build/source/texk/web2c/luatexdir/tex/packaging.w
+++ b/Build/source/texk/web2c/luatexdir/tex/packaging.w
@@ -21,8 +21,8 @@
#include "ptexlib.h"
static const char _svn_version[] =
- "$Id: packaging.w 3587 2010-04-03 14:32:25Z taco $"
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/packaging.w $";
+ "$Id: packaging.w 4044 2010-12-18 09:23:06Z taco $"
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/packaging.w $";
@ @c
#define scan_normal_dimen() scan_dimen(false,false,false)
@@ -115,7 +115,6 @@ void scan_full_spec(group_code c, int spec_direction)
int v;
int spec_code;
halfword attr_list;
- s = 0;
if (attr_list_cache == cache_disabled)
update_attribute_cache();
attr_list = attr_list_cache;
@@ -423,7 +422,6 @@ halfword hpack(halfword p, scaled w, int m, int pack_direction)
scaled s; /* shift amount */
halfword g; /* points to a glue specification */
int o; /* order of infinity */
- internal_font_number f; /* the font in a |char_node| */
halfword dir_ptr; /* for managing the direction stack */
/* BEWARE: this shadows a global |dir_ptr| */
int hpack_dir; /* the current direction */
@@ -438,7 +436,6 @@ halfword hpack(halfword p, scaled w, int m, int pack_direction)
box_dir(r) = text_direction;
} else {
box_dir(r) = pack_direction;
- pack_direction = -1;
}
hpack_dir = box_dir(r);
dir_ptr = null;
@@ -493,7 +490,6 @@ halfword hpack(halfword p, scaled w, int m, int pack_direction)
do_subst_font(p, font_expand_ratio);
}
}
- f = font(p);
whd = pack_width_height_depth(hpack_dir, dir_TRT, p, true);
x += whd.wd;
if (whd.ht > h)
@@ -533,7 +529,7 @@ halfword hpack(halfword p, scaled w, int m, int pack_direction)
case ins_node:
case mark_node:
case adjust_node:
- if (adjust_tail != null) {
+ if (adjust_tail != null || pre_adjust_tail != null) {
/* Transfer node |p| to the adjustment list */
/*
Although node |q| is not necessarily the immediate predecessor of node |p|,
@@ -852,7 +848,6 @@ scaled_whd natural_sizes(halfword p, halfword pp, glue_ratio g_mult,
{
scaled s; /* shift amount */
halfword g; /* points to a glue specification */
- internal_font_number f; /* the font in a |char_node| */
int hpack_dir;
scaled_whd xx; /* for recursion */
scaled_whd whd, siz = { 0, 0, 0 };
@@ -863,7 +858,6 @@ scaled_whd natural_sizes(halfword p, halfword pp, glue_ratio g_mult,
}
while (p != pp && p != null) {
while (is_char_node(p) && p != pp) {
- f = font(p);
whd = pack_width_height_depth(hpack_dir, dir_TRT, p, true);
siz.wd += whd.wd;
if (whd.ht > siz.ht)
diff --git a/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w b/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w
index e9a80961457..f96fd1cf861 100644
--- a/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w
+++ b/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w
@@ -21,8 +21,8 @@
#include "ptexlib.h"
static const char _svn_version[] =
- "$Id: postlinebreak.w 3587 2010-04-03 14:32:25Z taco $ "
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/postlinebreak.w $";
+ "$Id: postlinebreak.w 3904 2010-10-01 07:42:12Z taco $ "
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/postlinebreak.w $";
@ So far we have gotten a little way into the |line_break| routine, having
covered its important |try_break| subroutine. Now let's consider the
@@ -323,8 +323,8 @@ void ext_post_line_break(int paragraph_dir,
delete_attribute_ref(node_attr(k));
node_attr(k) = node_attr(p);
add_node_attr_ref(node_attr(k));
- vlink(k) = vlink(ptmp);
- vlink(ptmp) = k;
+ try_couple_nodes(k, vlink(ptmp));
+ couple_nodes(ptmp,k);
if (ptmp == q)
q = vlink(q);
}
@@ -335,13 +335,12 @@ void ext_post_line_break(int paragraph_dir,
/* Put the \.{\\rightskip} glue after node |q|; */
halfword r = new_glue((right_skip == null ? null : copy_node(right_skip)));
glue_ref_count(glue_ptr(r)) = null;
- subtype(r) = right_skip_code;
- vlink(r) = vlink(q);
+ subtype(r) = right_skip_code+1;
+ try_couple_nodes(r,vlink(q));
delete_attribute_ref(node_attr(r));
node_attr(r) = node_attr(q);
add_node_attr_ref(node_attr(r));
- vlink(q) = r;
- alink(r) = q;
+ couple_nodes(q,r);
q = r;
}
@@ -361,14 +360,14 @@ void ext_post_line_break(int paragraph_dir,
/* omega bits: */
r = copy_node_list(passive_left_box(cur_p));
s = vlink(q);
- vlink(r) = q;
+ couple_nodes(r,q);
q = r;
if ((cur_line == cur_list.pg_field + 1) && (s != null)) {
if (type(s) == hlist_node) {
if (list_ptr(s) == null) {
q = vlink(q);
- vlink(r) = vlink(s);
- vlink(s) = r;
+ try_couple_nodes(r,vlink(s));
+ try_couple_nodes(s, r);
}
}
}
@@ -383,19 +382,18 @@ void ext_post_line_break(int paragraph_dir,
delete_attribute_ref(node_attr(k));
node_attr(k) = node_attr(q);
add_node_attr_ref(node_attr(k));
- vlink(k) = q;
+ couple_nodes(k,q);
q = k;
}
- };
+ }
if (left_skip != zero_glue) {
r = new_glue(copy_node(left_skip));
glue_ref_count(glue_ptr(r)) = null;
- subtype(r) = left_skip_code;
+ subtype(r) = left_skip_code+1;
delete_attribute_ref(node_attr(r));
node_attr(r) = node_attr(q);
add_node_attr_ref(node_attr(r));
- vlink(r) = q;
- alink(q) = r;
+ couple_nodes(r,q);
q = r;
}
/* /Put the \.{\\leftskip} glue at the left and detach this line; */
@@ -541,7 +539,7 @@ void ext_post_line_break(int paragraph_dir,
break;
}
r = q;
- };
+ }
if (r != temp_head) {
vlink(r) = null;
flush_node_list(vlink(temp_head));
diff --git a/Build/source/texk/web2c/luatexdir/tex/primitive.w b/Build/source/texk/web2c/luatexdir/tex/primitive.w
index e40090dada0..3fd3f4ff9fa 100644
--- a/Build/source/texk/web2c/luatexdir/tex/primitive.w
+++ b/Build/source/texk/web2c/luatexdir/tex/primitive.w
@@ -22,8 +22,8 @@
static const char _svn_version[] =
- "$Id: primitive.w 3612 2010-04-13 09:29:42Z taco $ "
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/primitive.w $";
+ "$Id: primitive.w 4130 2011-04-11 13:27:56Z taco $ "
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/primitive.w $";
@ Control sequences are stored and retrieved by means of a fairly standard hash
@@ -127,9 +127,9 @@ void ini_init_primitives(void)
static halfword compute_hash(const char *j, unsigned int l,
halfword prime_number)
{
- unsigned int k;
+ int k;
halfword h = (unsigned char) *j;
- for (k = 1; k <= l - 1; k++) {
+ for (k = 1; k <= (int)(l - 1); k++) {
h = h + h + (unsigned char) *(j + k);
while (h >= prime_number)
h = h - prime_number;
@@ -389,6 +389,7 @@ static halfword insert_id(halfword p, const unsigned char *j, unsigned int l)
append_char(*k);
cs_text(p) = make_string();
cur_length = saved_cur_length;
+ xfree(cur_string);
cur_string = saved_cur_string;
cur_string_size = saved_cur_string_size;
incr(cs_count);
@@ -491,7 +492,7 @@ static void prim_cmd_chr(quarterword cmd, halfword chr_code)
if (cmd <= last_cmd &&
idx >= 0 && idx < prim_data[cmd].subids &&
prim_data[cmd].names != NULL && prim_data[cmd].names[idx] != 0) {
- tprint("\\");
+ tprint_esc("");
print(prim_data[cmd].names[idx]);
} else {
/* TEX82 didn't print the |cmd,idx| information, but it may be useful */
@@ -609,13 +610,6 @@ void print_cmd_chr(quarterword cmd, halfword chr_code)
}
break;
- case set_ocp_cmd:
- tprint("select ocp ");
- slow_print(ocp_name(chr_code));
- break;
- case set_ocp_list_cmd:
- tprint("select ocp list ");
- break;
case assign_glue_cmd:
case assign_mu_glue_cmd:
if (chr_code < skip_base) {
diff --git a/Build/source/texk/web2c/luatexdir/tex/printing.w b/Build/source/texk/web2c/luatexdir/tex/printing.w
index 278b8a70e71..9ea3fd98014 100644
--- a/Build/source/texk/web2c/luatexdir/tex/printing.w
+++ b/Build/source/texk/web2c/luatexdir/tex/printing.w
@@ -22,8 +22,8 @@
#include "ptexlib.h"
static const char _svn_version[] =
- "$Id: printing.w 3587 2010-04-03 14:32:25Z taco $"
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/printing.w $";
+ "$Id: printing.w 3885 2010-09-14 19:24:08Z oneiros $"
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/printing.w $";
@ @c
#define font_id_text(A) cs_text(font_id_base+(A))
@@ -361,10 +361,10 @@ void print_banner(const char *v, int e, int ver)
callback_id = callback_defined(start_run_callback);
if (callback_id == 0) {
if (ver < 0)
- fprintf(term_out, "This is LuaTeX, Version %s-%d%s ", v, e, WEB2CVERSION);
+ fprintf(term_out, "This is LuaTeX, Version %s-%d ", v, e);
else
- fprintf(term_out, "This is LuaTeX, Version %s-%d%s (rev %d) ", v, e,
- WEB2CVERSION, ver);
+ fprintf(term_out, "This is LuaTeX, Version %s-%d (rev %d) ", v, e,
+ ver);
if (format_ident > 0)
slow_print(format_ident);
print_ln();
@@ -390,9 +390,9 @@ void log_banner(const char *v, int e, int ver)
if (month > 12)
month = 0;
if (ver < 0)
- fprintf(log_file, "This is LuaTeX, Version %s-%d%s ", v, e, WEB2CVERSION);
+ fprintf(log_file, "This is LuaTeX, Version %s-%d ", v, e);
else
- fprintf(log_file, "This is LuaTeX, Version %s-%d%s (rev %d) ", v, e, WEB2CVERSION, ver);
+ fprintf(log_file, "This is LuaTeX, Version %s-%d (rev %d) ", v, e, ver);
slow_print(format_ident);
print_char(' ');
print_char(' ');
@@ -543,14 +543,14 @@ works; therefore no explanation will be given. Notice that 1990 yields
void print_roman_int(int n)
{
char *j, *k; /* mysterious indices */
- nonnegative_integer u, v; /* mysterious numbers */
+ int u, v; /* mysterious numbers */
char mystery[] = "m2d5c2l5x2v5i";
j = (char *) mystery;
v = 1000;
while (1) {
- while (n >= (int) v) {
+ while (n >= v) {
print_char(*j);
- n = n - (int) v;
+ n = n - v;
}
if (n <= 0)
return; /* nonpositive input produces no output */
@@ -560,9 +560,9 @@ void print_roman_int(int n)
k = k + 2;
u = u / (*(k - 1) - '0');
}
- if (n + (int) u >= (int) v) {
+ if (n + u >= v) {
print_char(*k);
- n = n + (int) u;
+ n = n + u;
} else {
j = j + 2;
v = v / (*(j - 1) - '0');
diff --git a/Build/source/texk/web2c/luatexdir/tex/scanning.h b/Build/source/texk/web2c/luatexdir/tex/scanning.h
index 853a22a9a46..8c263404173 100644
--- a/Build/source/texk/web2c/luatexdir/tex/scanning.h
+++ b/Build/source/texk/web2c/luatexdir/tex/scanning.h
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: scanning.h 3376 2010-01-25 16:50:23Z taco $ */
+/* $Id: scanning.h 4085 2011-02-10 09:21:57Z taco $ */
#ifndef SCANNING_H
# define SCANNING_H
@@ -50,7 +50,7 @@ extern void scan_limited_int(int max, const char *name);
# define scan_mark_num() scan_limited_int(65535,"marks code")
# define scan_char_num() scan_limited_int(biggest_char,"character code")
# define scan_four_bit_int() scan_limited_int(15,NULL)
-# define scan_math_family_int() scan_limited_int(265,"math family")
+# define scan_math_family_int() scan_limited_int(255,"math family")
# define scan_real_fifteen_bit_int() scan_limited_int(32767,"mathchar")
# define scan_big_fifteen_bit_int() scan_limited_int(0x7FFFFFF,"extended mathchar")
# define scan_twenty_seven_bit_int() scan_limited_int(0777777777,"delimiter code")
diff --git a/Build/source/texk/web2c/luatexdir/tex/scanning.w b/Build/source/texk/web2c/luatexdir/tex/scanning.w
index a968dae4a4b..86a2c01cee3 100644
--- a/Build/source/texk/web2c/luatexdir/tex/scanning.w
+++ b/Build/source/texk/web2c/luatexdir/tex/scanning.w
@@ -21,8 +21,8 @@
#include "ptexlib.h"
static const char _svn_version[] =
- "$Id: scanning.w 3596 2010-04-05 10:12:46Z taco $"
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/scanning.w $";
+ "$Id: scanning.w 3713 2010-06-04 10:47:19Z taco $"
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/scanning.w $";
@ @c
@@ -1556,7 +1556,6 @@ void scan_scaled(void)
arith_error = false;
negative = false;
/* Get the next non-blank non-sign... */
- negative = false;
do {
/* Get the next non-blank non-call token */
do {
diff --git a/Build/source/texk/web2c/luatexdir/tex/stringpool.h b/Build/source/texk/web2c/luatexdir/tex/stringpool.h
index 51eb4fd7195..21e031acc86 100644
--- a/Build/source/texk/web2c/luatexdir/tex/stringpool.h
+++ b/Build/source/texk/web2c/luatexdir/tex/stringpool.h
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: stringpool.h 3395 2010-01-27 11:40:08Z taco $ */
+/* $Id: stringpool.h 3802 2010-08-07 12:03:08Z taco $ */
#ifndef STRINGPOOL_H
# define STRINGPOOL_H
@@ -115,6 +115,7 @@ extern void reset_cur_string(void);
# define restore_cur_string(u) if (u!=0) { \
unsigned l = (unsigned)str_length(u); \
+ xfree(cur_string); \
reset_cur_string(); \
str_room(l); \
memcpy(cur_string, str_string(u),l); \
diff --git a/Build/source/texk/web2c/luatexdir/tex/stringpool.w b/Build/source/texk/web2c/luatexdir/tex/stringpool.w
index d41276c819d..330ad02dee9 100644
--- a/Build/source/texk/web2c/luatexdir/tex/stringpool.w
+++ b/Build/source/texk/web2c/luatexdir/tex/stringpool.w
@@ -22,7 +22,7 @@
static const char _svn_version[] =
"$Id: stringpool.w 3587 2010-04-03 14:32:25Z taco $ "
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/stringpool.w $";
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/stringpool.w $";
@ Control sequence names and diagnostic messages are variable-length strings
of eight-bit characters. Since PASCAL did not have a well-developed string
diff --git a/Build/source/texk/web2c/luatexdir/tex/texdeffont.w b/Build/source/texk/web2c/luatexdir/tex/texdeffont.w
index 993280def9c..10f88040be6 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texdeffont.w
+++ b/Build/source/texk/web2c/luatexdir/tex/texdeffont.w
@@ -21,7 +21,7 @@
#include "ptexlib.h"
static const char _svn_version[] =
- "$Id: texdeffont.w 3612 2010-04-13 09:29:42Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/texdeffont.w $";
+ "$Id: texdeffont.w 3615 2010-04-13 21:59:59Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/texdeffont.w $";
diff --git a/Build/source/texk/web2c/luatexdir/tex/texfileio.h b/Build/source/texk/web2c/luatexdir/tex/texfileio.h
index 77b7a6dd5b5..0ec6605b18c 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texfileio.h
+++ b/Build/source/texk/web2c/luatexdir/tex/texfileio.h
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: texfileio.h 3395 2010-01-27 11:40:08Z taco $ */
+/* $Id: texfileio.h 4005 2010-11-29 11:52:43Z taco $ */
#ifndef TEXFILEIO_H
# define TEXFILEIO_H
@@ -116,6 +116,7 @@ extern boolean log_opened; /* has the transcript file been opened? */
extern unsigned char *texmf_log_name; /* full name of the log file */
extern void open_log_file(void);
+extern char *get_full_log_name (void);
extern void start_input(void);
extern int open_outfile(FILE ** f, const char *name, const char *mode);
@@ -129,7 +130,6 @@ extern int readbinfile(FILE * f, unsigned char **b, int *s);
# define read_tfm_file readbinfile
# define read_vf_file readbinfile
-# define read_ocp_file readbinfile
# define read_data_file readbinfile
extern boolean openinnameok(const_string);
diff --git a/Build/source/texk/web2c/luatexdir/tex/texfileio.w b/Build/source/texk/web2c/luatexdir/tex/texfileio.w
index ccae2f15433..652265d0119 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texfileio.w
+++ b/Build/source/texk/web2c/luatexdir/tex/texfileio.w
@@ -23,12 +23,13 @@
#include <kpathsea/absolute.h>
static const char _svn_version[] =
- "$Id: texfileio.w 3719 2010-06-10 16:58:16Z taco $"
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/texfileio.w $";
+ "$Id: texfileio.w 4128 2011-04-11 12:37:47Z taco $"
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/texfileio.w $";
@ @c
#define end_line_char int_par(end_line_char_code)
+
@ The bane of portability is the fact that different operating systems treat
input and output quite differently, perhaps because computer scientists
have not given sufficient attention to this problem. People have felt somehow
@@ -163,9 +164,6 @@ char *luatex_find_file(const char *s, int callback_index)
if (ftemp == NULL)
ftemp = kpse_find_file(s, kpse_truetype_format, 0);
break;
- case find_ocp_file_callback:
- ftemp = kpse_find_file(s, kpse_ocp_format, 0);
- break;
case find_data_file_callback:
ftemp = find_in_output_directory(s);
if (!ftemp)
@@ -192,6 +190,18 @@ char *luatex_find_file(const char *s, int callback_index)
}
+@ LuaTeX used to have private functions for these that did not use kpathsea,
+but since the file paranoia tests have to come from kpathsea anyway, that is no
+longer useful. The only downside to using luatex is that if one wants to disable
+kpathsea via the Lua startup script, it is now an absolute requirement that all
+file discovery callbacks are specified. Just using the find_read_file, but not
+setting open_read_file, for example, does not work any more if kpathsea is not
+to be used at all.
+
+@c
+#define openoutnameok(A) kpse_out_name_ok (A)
+#define openinnameok(A) kpse_in_name_ok (A)
+
@ Open an input file F, using the kpathsea format FILEFMT and passing
|FOPEN_MODE| to fopen. The filename is in `fn'. We return whether or
not the open succeeded.
@@ -830,6 +840,22 @@ void open_log_file(void)
selector = old_setting + 2; /* |log_only| or |term_and_log| */
}
+@ This function is needed by synctex to make its log appear in the right
+spot when |output_directory| is set.
+
+@c
+char *get_full_log_name (void)
+{
+ if (output_directory) {
+ char *ret = xmalloc(strlen((char *)texmf_log_name)+2+strlen(output_directory));
+ ret = strcpy(ret, output_directory);
+ strcat(ret, "/");
+ strcat(ret, (char *)texmf_log_name);
+ return ret;
+ } else {
+ return xstrdup((const char*)texmf_log_name);
+ }
+}
@ Let's turn now to the procedure that is used to initiate file reading
when an `\.{\\input}' command is being processed.
@@ -858,6 +884,36 @@ void start_input(void)
fn = prompt_file_name("input file name", "");
}
iname = maketexstring(fullnameoffile);
+ /* Now that we have |fullnameoffile|, it is time to post-adjust
+ |cur_name| and |cur_ext| for trailing |.tex| */
+ {
+ char *n, *p;
+ n = p = fullnameoffile + strlen(fullnameoffile);
+ while (p>fullnameoffile) {
+ p--;
+ if (IS_DIR_SEP(*p)) {
+ break;
+ }
+ }
+ if (IS_DIR_SEP(*p)) {
+ p++;
+ }
+ while (n>fullnameoffile) {
+ n--;
+ if (*n == '.') {
+ break;
+ }
+ }
+ if (n>p) {
+ int q = *n;
+ cur_ext = maketexstring(n);
+ *n = 0;
+ cur_name = maketexstring(p);
+ *n = q;
+ }
+ }
+
+
source_filename_stack[in_open] = iname;
full_source_filename_stack[in_open] = xstrdup(fullnameoffile);
/* we can try to conserve string pool space now */
@@ -1086,187 +1142,6 @@ static FILE *runpopen(char *cmd, const char *mode)
return f;
}
-@ Return true if FNAME is acceptable as a name for \.{\\openout}, \.{\\openin}, or
- \.{\\input}.
-
-@c
-typedef enum ok_type {
- ok_reading,
- ok_writing
-} ok_type;
-
-static const_string ok_type_name[] = {
- "reading",
- "writing"
-};
-
-static boolean
-opennameok(const_string fname, const_string check_var,
- const_string default_choice, ok_type action)
-{
- /* We distinguish three cases:
- 'a' (any) allows any file to be opened.
- 'r' (restricted) means disallowing special file names.
- 'p' (paranoid) means being really paranoid: disallowing special file
- names and restricting output files to be in or below
- the working directory or $TEXMFOUTPUT, while input files
- must be below the current directory, $TEXMFOUTPUT, or
- (implicitly) in the system areas.
- We default to "paranoid". The error messages from TeX will be somewhat
- puzzling...
- This function contains several return statements... */
-
- const_string open_choice = kpse_var_value(check_var);
-
- if (!open_choice)
- open_choice = default_choice;
-
- if (*open_choice == 'a' || *open_choice == 'y' || *open_choice == '1')
- return true;
-
-#if defined (unix) && !defined (MSDOS)
- {
- const_string base = xbasename(fname);
- /* Disallow .rhosts, .login, etc. Allow .tex (for LaTeX). */
- if (base[0] == 0 ||
- (base[0] == '.' && !IS_DIR_SEP(base[1]) && !STREQ(base, ".tex"))) {
- fprintf(stderr, "%s: Not %s to %s (%s = %s).\n",
- kpse_invocation_name, ok_type_name[action], fname,
- check_var, open_choice);
- return false;
- }
- }
-#else
- /* Other OSs don't have special names? */
-#endif
-
- if (*open_choice == 'r' || *open_choice == 'n' || *open_choice == '0')
- return true;
-
- /* Paranoia supplied by Charles Karney... */
- if (kpse_absolute_p(fname, false)) {
- const_string texmfoutput = kpse_var_value("TEXMFOUTPUT");
- /* Absolute pathname is only OK if TEXMFOUTPUT is set, it's not empty,
- fname begins the TEXMFOUTPUT, and is followed by / */
- if (!texmfoutput || *texmfoutput == '\0'
- || fname != strstr(fname, texmfoutput)
- || !IS_DIR_SEP(fname[strlen(texmfoutput)])) {
- fprintf(stderr, "%s: Not %s to %s (%s = %s).\n",
- kpse_invocation_name, ok_type_name[action], fname,
- check_var, open_choice);
- return false;
- }
- }
- /* For all pathnames, we disallow "../" at the beginning or "/../"
- anywhere. */
- if (fname[0] == '.' && fname[1] == '.' && IS_DIR_SEP(fname[2])) {
- fprintf(stderr, "%s: Not %s to %s (%s = %s).\n",
- kpse_invocation_name, ok_type_name[action], fname,
- check_var, open_choice);
- return false;
- } else {
- /* Check for "/../". Since more than one characted can be matched
- by |IS_DIR_SEP|, we cannot use "/../" itself. */
- const_string dotpair = strstr(fname, "..");
- while (dotpair) {
- /* If dotpair[2] == |DIR_SEP|, then dotpair[-1] is well-defined,
- because the "../" case was handled above. */
- if (IS_DIR_SEP(dotpair[2]) && IS_DIR_SEP(dotpair[-1])) {
- fprintf(stderr, "%s: Not %s to %s (%s = %s).\n",
- kpse_invocation_name, ok_type_name[action], fname,
- check_var, open_choice);
- return false;
- }
- /* Continue after the dotpair. */
- dotpair = strstr(dotpair + 2, "..");
- }
- }
-
- /* We passed all tests. */
- return true;
-}
-
-boolean openinnameok(const_string fname)
-{
- /* For input default to all. */
- return opennameok(fname, "openin_any", "a", ok_reading);
-}
-
-#if defined(WIN32) || defined(__MINGW32__) || defined(__CYGWIN__)
-
-static int Isspace(char c)
-{
- return (c == ' ' || c == '\t');
-}
-
-static boolean executable_filep(const_string fname)
-{
- string p, q, base;
- string *pp;
-
- /* check |openout_any| */
- p = kpse_var_value("openout_any");
- if (p && *p == 'p') {
- free(p);
-/* get base name
- we cannot use xbasename() for abnormal names.
-*/
- base = xstrdup(fname);
- p = strrchr(fname, '/');
- if (p) {
- p++;
- strcpy(base, p);
- }
- p = strrchr(base, '\\');
- if (p) {
- p++;
- strcpy(base, p);
- }
-# if defined(__CYGWIN__)
- for (p = base; *p; p++)
- *p = tolower(*p);
- p = base;
-# else
- p = (char *) strlwr(base);
-# endif
- for (q = p + strlen(p) - 1;
- (q >= p) && ((*q == '.') || (Isspace(*q))); q--) {
- *q = '\0'; /* remove trailing '.' , ' ' and '\t' */
- }
- q = strrchr(p, '.'); /* get extension part */
- pp = suffixlist;
- if (pp && q) {
- while (*pp) {
- if (strchr(fname, ':') || !strcmp(q, *pp)) {
- fprintf(stderr,
- "\nThe name %s is forbidden to open for writing.\n",
- fname);
- free(base);
- return true;
- }
- pp++;
- }
- }
- free(base);
- } else if (p) {
- free(p);
- }
- return false;
-}
-#endif
-
-boolean openoutnameok(const_string fname)
-{
-#if defined(WIN32) || defined(__MINGW32__) || defined(__CYGWIN__)
- /* Output of an executable file is restricted on Windows */
- if (executable_filep(fname))
- return false;
-#endif
- /* For output, default to paranoid. */
- return opennameok(fname, "openout_any", "p", ok_writing);
-}
-
-
@ piped I/O
diff --git a/Build/source/texk/web2c/luatexdir/tex/texmath.w b/Build/source/texk/web2c/luatexdir/tex/texmath.w
index f435ddb312f..47ed05d2651 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texmath.w
+++ b/Build/source/texk/web2c/luatexdir/tex/texmath.w
@@ -21,8 +21,8 @@
#include "ptexlib.h"
static const char _svn_version[] =
- "$Id: texmath.w 3612 2010-04-13 09:29:42Z taco $ "
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/texmath.w $";
+ "$Id: texmath.w 3981 2010-11-26 12:26:44Z taco $ "
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/texmath.w $";
@ @c
#define mode cur_list.mode_field
@@ -715,20 +715,62 @@ void display_normal_noad(pointer p)
}
break;
case accent_noad:
+ if (accent_chr(p) != null) {
+ if (bot_accent_chr(p) != null) {
+ tprint_esc("Umathaccent both");
+ } else {
+ tprint_esc("Umathaccent");
+ }
+ } else {
+ tprint_esc("Umathaccent bottom");
+ }
+ switch (subtype(p)) {
+ case 0:
if (accent_chr(p) != null) {
if (bot_accent_chr(p) != null) {
- tprint_esc("Umathaccents");
print_fam_and_char(accent_chr(p));
print_fam_and_char(bot_accent_chr(p));
} else {
- tprint_esc("accent");
print_fam_and_char(accent_chr(p));
}
} else {
- tprint_esc("Umathbotaccent");
print_fam_and_char(bot_accent_chr(p));
}
break;
+ case 1:
+ if (accent_chr(p) != null) {
+ tprint(" fixed ");
+ print_fam_and_char(accent_chr(p));
+ if (bot_accent_chr(p) != null) {
+ print_fam_and_char(bot_accent_chr(p));
+ }
+ } else {
+ confusion("display_accent_noad");
+ }
+ break;
+ case 2:
+ if (bot_accent_chr(p) != null) {
+ if (accent_chr(p) != null) {
+ print_fam_and_char(accent_chr(p));
+ }
+ tprint(" fixed ");
+ print_fam_and_char(bot_accent_chr(p));
+ } else{
+ confusion("display_accent_noad");
+ }
+ break;
+ case 3:
+ if (accent_chr(p) != null && bot_accent_chr(p) != null) {
+ tprint(" fixed ");
+ print_fam_and_char(accent_chr(p));
+ tprint(" fixed ");
+ print_fam_and_char(bot_accent_chr(p));
+ } else {
+ confusion("display_accent_noad");
+ }
+ break;
+ }
+ break;
}
print_subsidiary_data(nucleus(p), '.');
print_subsidiary_data(supscr(p), '^');
@@ -1556,10 +1598,31 @@ void math_ac(void)
} else if (cur_chr == 1) { /* \.{\\omathaccent} */
t = scan_mathchar(aleph_mathcode);
} else if (cur_chr == 2) { /* \.{\\Umathaccent} */
- t = scan_mathchar(xetex_mathcode);
- } else if (cur_chr == 3) { /* \.{\\Umathbotaccent} */
+ if (scan_keyword("fixed")) {
+ subtype(tail) = 1;
+ t = scan_mathchar(xetex_mathcode);
+ } else if (scan_keyword("both")) {
+ if (scan_keyword("fixed")) {
+ subtype(tail) = 1;
+ }
+ t = scan_mathchar(xetex_mathcode);
+ if (scan_keyword("fixed")) {
+ subtype(tail) += 2;
+ }
+ b = scan_mathchar(xetex_mathcode);
+ } else if (scan_keyword("bottom")) {
+ if (scan_keyword("fixed")) {
+ subtype(tail) = 2;
+ }
+ b = scan_mathchar(xetex_mathcode);
+ } else {
+ t = scan_mathchar(xetex_mathcode);
+ }
+ } else if (cur_chr == 3) { /* deprecated: \.{\\Umathbotaccent} */
+ pdftex_warn("\\Umathbotaccent is deprecated, please update to \\Umathaccent bottom");
b = scan_mathchar(xetex_mathcode);
- } else if (cur_chr == 4) { /* \.{\\Umathaccents} */
+ } else if (cur_chr == 4) { /* deprecated: \.{\\Umathaccents} */
+ pdftex_warn("\\Umathaccents is deprecated, please update to \\Umathaccent both");
t = scan_mathchar(xetex_mathcode);
b = scan_mathchar(xetex_mathcode);
} else {
@@ -2209,15 +2272,10 @@ resulting list, and with |aux_save| holding the |prev_depth| value.
void finish_display_alignment(pointer p, pointer q, halfword saved_prevdepth)
{
do_assignments();
- if (cur_cmd != math_shift_cmd) {
- const char *hlp[] = {
- "Displays can use special alignments (like \\eqalignno)",
- "only if nothing but the alignment itself is between $$'s.",
- NULL
- };
- back_error("Missing $$ inserted", hlp);
- } else {
+ if (cur_cmd == math_shift_cmd) {
check_second_math_shift();
+ } else {
+ check_display_math_end();
}
pop_nest();
tail_append(new_penalty(int_par(pre_display_penalty_code)));
diff --git a/Build/source/texk/web2c/luatexdir/tex/texnodes.h b/Build/source/texk/web2c/luatexdir/tex/texnodes.h
index 556f8fb2c72..45c84032fd8 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texnodes.h
+++ b/Build/source/texk/web2c/luatexdir/tex/texnodes.h
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: texnodes.h 3552 2010-03-26 15:30:08Z taco $ */
+/* $Id: texnodes.h 4090 2011-02-28 08:51:20Z taco $ */
#include <stdarg.h>
@@ -183,13 +183,16 @@ typedef enum {
# define acc_kern 2 /*|subtype| of kern nodes from accents */
# define synctex_tag_kern(a) vinfo((a)+3)
# define synctex_line_kern(a) vlink((a)+3)
-# define ex_kern(a) vinfo((a)+4) /* expansion factor (hz) */
+# define ex_kern(a) vinfo((a)+4) /* expansion factor (hz) */
# define box_node_size 9
# define HLIST_SUBTYPE_UNKNOWN 0
-# define HLIST_SUBTYPE_LINE 1
-# define HLIST_SUBTYPE_HBOX 2
+# define HLIST_SUBTYPE_LINE 1 /* paragraph lines */
+# define HLIST_SUBTYPE_HBOX 2 /* \.{\\hbox} */
+# define HLIST_SUBTYPE_INDENT 3 /* indentation box */
+# define HLIST_SUBTYPE_ALIGNROW 4 /* row from a \.{\\halign} or \.{\\valign} */
+# define HLIST_SUBTYPE_ALIGNCELL 5 /* cell from a \.{\\halign} or \.{\\valign} */
# define width(a) varmem[(a)+2].cint
# define depth(a) varmem[(a)+3].cint
@@ -353,6 +356,9 @@ typedef enum {
# define nodetype_has_attributes(t) (((t)<=glyph_node) && ((t)!=unset_node))
+# define nodetype_has_subtype(t) ((t)!=action_node && (t)!=attribute_list_node && (t)!=attribute_node && (t)!=glue_spec_node)
+# define nodetype_has_prev(t) nodetype_has_subtype((t))
+
/* style and choice nodes */
/* style nodes can be smaller, the information is encoded in |subtype|,
but choice nodes are on-the-spot converted to style nodes */
@@ -538,6 +544,7 @@ typedef enum {
# define late_lua_data(a) vlink((a)+2)
# define late_lua_reg(a) vinfo((a)+2)
# define late_lua_name(a) vlink((a)+3)
+# define late_lua_type(a) subtype((a)+3)
# define local_par_size 6
@@ -687,7 +694,8 @@ extern pointer actual_box_width(pointer r, scaled base_width);
/* TH: these two defines still need checking. The node ordering in luatex is not
quite the same as in tex82 */
-# define precedes_break(a) (type((a))<math_node && (type(a)!=whatsit_node || subtype(a)!=dir_node))
+# define precedes_break(a) (type((a))<math_node && \
+ (type(a)!=whatsit_node || (subtype(a)!=dir_node && subtype(a)!=local_par_node)))
# define non_discardable(a) (type((a))<math_node)
/* from luanode.c */
diff --git a/Build/source/texk/web2c/luatexdir/tex/texnodes.w b/Build/source/texk/web2c/luatexdir/tex/texnodes.w
index 74ee9c9bc59..3e971013d21 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texnodes.w
+++ b/Build/source/texk/web2c/luatexdir/tex/texnodes.w
@@ -19,8 +19,8 @@
@ @c
static const char _svn_version[] =
- "$Id: texnodes.w 3612 2010-04-13 09:29:42Z taco $ "
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/texnodes.w $";
+ "$Id: texnodes.w 4139 2011-04-12 08:37:27Z taco $ "
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/texnodes.w $";
#include "ptexlib.h"
#include "lua/luatex-api.h"
@@ -72,14 +72,14 @@ int copy_error(halfword p); /* define below */
const char *node_fields_list[] =
{ "attr", "width", "depth", "height", "dir", "shift",
- "glue_order", "glue_sign", "glue_set", "list", NULL
+ "glue_order", "glue_sign", "glue_set", "head", NULL
};
const char *node_fields_rule[] =
{ "attr", "width", "depth", "height", "dir", NULL };
const char *node_fields_insert[] =
- { "attr", "cost", "depth", "height", "spec", "list", NULL };
+ { "attr", "cost", "depth", "height", "spec", "head", NULL };
const char *node_fields_mark[] = { "attr", "class", "mark", NULL };
-const char *node_fields_adjust[] = { "attr", "list", NULL };
+const char *node_fields_adjust[] = { "attr", "head", NULL };
const char *node_fields_disc[] = { "attr", "pre", "post", "replace", NULL };
const char *node_fields_math[] = { "attr", "surround", NULL };
const char *node_fields_glue[] = { "attr", "spec", "leader", NULL };
@@ -88,7 +88,7 @@ const char *node_fields_penalty[] = { "attr", "penalty", NULL };
const char *node_fields_unset[] =
{ "attr", "width", "depth", "height", "dir", "shrink",
- "glue_order", "glue_sign", "stretch", "span", "list", NULL
+ "glue_order", "glue_sign", "stretch", "span", "head", NULL
};
const char *node_fields_margin_kern[] = { "attr", "width", "glyph", NULL };
@@ -118,8 +118,8 @@ const char *node_fields_accent[] =
{ "attr", "nucleus", "sub", "sup", "accent", "bot_accent", NULL };
const char *node_fields_fence[] = { "attr", "delim", NULL };
const char *node_fields_math_char[] = { "attr", "fam", "char", NULL };
-const char *node_fields_sub_box[] = { "attr", "list", NULL };
-const char *node_fields_sub_mlist[] = { "attr", "list", NULL };
+const char *node_fields_sub_box[] = { "attr", "head", NULL };
+const char *node_fields_sub_mlist[] = { "attr", "head", NULL };
const char *node_fields_math_text_char[] = { "attr", "fam", "char", NULL };
const char *node_fields_delim[] =
{ "attr", "small_fam", "small_char", "large_fam", "large_char", NULL };
@@ -186,7 +186,7 @@ const char *node_fields_whatsit_pdf_start_thread[] =
const char *node_fields_whatsit_pdf_end_thread[] = { "attr", NULL };
const char *node_fields_whatsit_pdf_save_pos[] = { "attr", NULL };
const char *node_fields_whatsit_late_lua[] =
- { "attr", "reg", "data", "name", NULL };
+ { "attr", "reg", "data", "name", "string", NULL };
const char *node_fields_whatsit_close_lua[] = { "attr", "reg", NULL };
const char *node_fields_whatsit_pdf_colorstack[] =
{ "attr", "stack", "cmd", "data", NULL };
@@ -232,11 +232,9 @@ node_info node_data[] = {
{math_char_node, math_kernel_node_size, node_fields_math_char, "math_char"},
{sub_box_node, math_kernel_node_size, node_fields_sub_box, "sub_box"},
{sub_mlist_node, math_kernel_node_size, node_fields_sub_mlist, "sub_mlist"},
- {math_text_char_node, math_kernel_node_size, node_fields_math_text_char,
- "math_text_char"},
+ {math_text_char_node, math_kernel_node_size, node_fields_math_text_char, "math_text_char"},
{delim_node, math_shield_node_size, node_fields_delim, "delim"},
- {margin_kern_node, margin_kern_node_size, node_fields_margin_kern,
- "margin_kern"},
+ {margin_kern_node, margin_kern_node_size, node_fields_margin_kern, "margin_kern"},
{glyph_node, glyph_node_size, node_fields_glyph, "glyph"},
{align_record_node, box_node_size, NULL, "align_record"},
{pseudo_file_node, pseudo_file_node_size, NULL, "pseudo_file"},
@@ -248,8 +246,7 @@ node_info node_data[] = {
{span_node, span_node_size, NULL, "span"},
{attribute_node, attribute_node_size, node_fields_attribute, "attribute"},
{glue_spec_node, glue_spec_size, node_fields_glue_spec, "glue_spec"},
- {attribute_list_node, attribute_node_size, node_fields_attribute_list,
- "attribute_list"},
+ {attribute_list_node, attribute_node_size, node_fields_attribute_list, "attribute_list"},
{action_node, pdf_action_size, node_fields_action, "action"},
{temp_node, temp_node_size, NULL, "temp"},
{align_stack_node, align_stack_node_size, NULL, "align_stack"},
@@ -390,10 +387,12 @@ halfword new_node(int i, int j)
but the overall allocation faster then an explicit test
at the top of |new_node()|.
*/
- free_node(n, variable_node_size);
- n = slow_get_node(j);
- (void) memset((void *) (varmem + n + 1), 0,
+ if (j>0) {
+ free_node(n, variable_node_size);
+ n = slow_get_node(j);
+ (void) memset((void *) (varmem + n + 1), 0,
(sizeof(memory_word) * ((unsigned) j - 1)));
+ }
break;
default:
break;
@@ -660,9 +659,7 @@ halfword copy_node(const halfword p)
add_token_ref(pdf_setmatrix_data(p));
break;
case late_lua_node:
- if (late_lua_name(p) > 0)
- add_token_ref(late_lua_name(p));
- add_token_ref(late_lua_data(p));
+ copy_late_lua(r, p);
break;
case pdf_annot_node:
add_token_ref(pdf_annot_data(p));
@@ -957,9 +954,7 @@ void flush_node(halfword p)
delete_token_ref(pdf_setmatrix_data(p));
break;
case late_lua_node:
- if (late_lua_name(p) > 0)
- delete_token_ref(late_lua_name(p));
- delete_token_ref(late_lua_data(p));
+ free_late_lua(p);
break;
case pdf_annot_node:
delete_token_ref(pdf_annot_data(p));
@@ -1194,7 +1189,8 @@ void check_node(halfword p)
case late_lua_node:
if (late_lua_name(p) > 0)
check_token_ref(late_lua_name(p));
- check_token_ref(late_lua_data(p));
+ if (late_lua_type(p) == normal)
+ check_token_ref(late_lua_data(p));
break;
case pdf_annot_node:
check_token_ref(pdf_annot_data(p));
@@ -1575,33 +1571,43 @@ void init_node_mem(int t)
shrink_order(fil_neg_glue) = normal;
/* initialize node list heads */
vinfo(page_ins_head) = 0;
+ type(page_ins_head) = temp_node;
vlink(page_ins_head) = null;
alink(page_ins_head) = null;
vinfo(contrib_head) = 0;
+ type(contrib_head) = temp_node;
vlink(contrib_head) = null;
alink(contrib_head) = null;
vinfo(page_head) = 0;
+ type(page_head) = temp_node;
vlink(page_head) = null;
alink(page_head) = null;
vinfo(temp_head) = 0;
+ type(temp_head) = temp_node;
vlink(temp_head) = null;
alink(temp_head) = null;
vinfo(hold_head) = 0;
+ type(hold_head) = temp_node;
vlink(hold_head) = null;
alink(hold_head) = null;
vinfo(adjust_head) = 0;
+ type(adjust_head) = temp_node;
vlink(adjust_head) = null;
alink(adjust_head) = null;
vinfo(pre_adjust_head) = 0;
+ type(pre_adjust_head) = temp_node;
vlink(pre_adjust_head) = null;
alink(pre_adjust_head) = null;
vinfo(active) = 0;
+ type(active) = unhyphenated_node;
vlink(active) = null;
alink(active) = null;
vinfo(align_head) = 0;
+ type(align_head) = temp_node;
vlink(align_head) = null;
alink(align_head) = null;
vinfo(end_span) = 0;
+ type(end_span) = span_node;
vlink(end_span) = null;
alink(end_span) = null;
type(begin_point) = glyph_node;
@@ -2334,9 +2340,7 @@ static void show_whatsit_node(int p)
tprint_esc("noboundary");
break;
case late_lua_node:
- tprint_esc("latelua");
- print_int(late_lua_reg(p));
- print_mark(late_lua_data(p));
+ show_late_lua(p);
break;
case close_lua_node:
tprint_esc("closelua");
@@ -2812,6 +2816,11 @@ void show_node_list(int p)
tprint(" pre ");
node_list_display(adjust_ptr(p)); /* recursive call */
break;
+ case glue_spec_node:
+ tprint("<glue_spec ");
+ print_spec(p, NULL);
+ tprint(">");
+ break;
default:
show_math_node(p);
break;
diff --git a/Build/source/texk/web2c/luatexdir/tex/textcodes.w b/Build/source/texk/web2c/luatexdir/tex/textcodes.w
index 5f237c58481..fae9ba9ce87 100644
--- a/Build/source/texk/web2c/luatexdir/tex/textcodes.w
+++ b/Build/source/texk/web2c/luatexdir/tex/textcodes.w
@@ -21,8 +21,8 @@
#include "ptexlib.h"
static const char _svn_version[] =
- "$Id: textcodes.w 3612 2010-04-13 09:29:42Z taco $ "
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/textcodes.w $";
+ "$Id: textcodes.w 3615 2010-04-13 21:59:59Z oneiros $ "
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/textcodes.w $";
@ @c
#define LCCODESTACK 8
diff --git a/Build/source/texk/web2c/luatexdir/tex/textoken.h b/Build/source/texk/web2c/luatexdir/tex/textoken.h
index 7af0bf4ee51..b57c42282ea 100644
--- a/Build/source/texk/web2c/luatexdir/tex/textoken.h
+++ b/Build/source/texk/web2c/luatexdir/tex/textoken.h
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: textoken.h 3723 2010-06-18 09:19:27Z taco $ */
+/* $Id: textoken.h 3853 2010-09-03 18:05:14Z oneiros $ */
#ifndef TEXTOKEN_H
# define TEXTOKEN_H
@@ -48,10 +48,10 @@ typedef struct smemory_word_ {
# ifdef WORDS_BIGENDIAN
halfword hhrh;
halfword hhlh;
-#else
+# else
halfword hhlh;
halfword hhrh;
-#endif
+# endif
} smemory_word;
# define fix_mem_init 10000
diff --git a/Build/source/texk/web2c/luatexdir/tex/textoken.w b/Build/source/texk/web2c/luatexdir/tex/textoken.w
index 501371bc3e1..2a57eff17c5 100644
--- a/Build/source/texk/web2c/luatexdir/tex/textoken.w
+++ b/Build/source/texk/web2c/luatexdir/tex/textoken.w
@@ -19,8 +19,8 @@
@ @c
static const char _svn_version[] =
- "$Id: textoken.w 3612 2010-04-13 09:29:42Z taco $"
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/tex/textoken.w $";
+ "$Id: textoken.w 4032 2010-12-11 09:38:19Z taco $"
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/textoken.w $";
#include "ptexlib.h"
@@ -480,45 +480,37 @@ boolean scan_keyword(const char *s)
halfword q; /* new node being added to the token list via |store_new_token| */
const char *k; /* index into |str_pool| */
halfword save_cur_cs = cur_cs;
- if (strlen(s) == 1) {
- /* Get the next non-blank non-call token; */
- do {
- get_x_token();
- } while ((cur_cmd == spacer_cmd) || (cur_cmd == relax_cmd));
- if ((cur_cs == 0) && ((cur_chr == *s) || (cur_chr == *s - 'a' + 'A'))) {
- return true;
- } else {
+ int saved_align_state = align_state;
+ assert (strlen(s) > 1);
+ p = backup_head;
+ token_link(p) = null;
+ k = s;
+ while (*k) {
+ get_x_token(); /* recursion is possible here */
+ if ((cur_cs == 0) &&
+ ((cur_chr == *k) || (cur_chr == *k - 'a' + 'A'))) {
+ store_new_token(cur_tok);
+ k++;
+ } else if ((cur_cmd != spacer_cmd) || (p != backup_head)) {
+ if (p != backup_head) {
+ q = get_avail();
+ token_info(q) = cur_tok;
+ token_link(q) = null;
+ token_link(p) = q;
+ begin_token_list(token_link(backup_head), backed_up);
+ if (cur_cmd != endv_cmd)
+ align_state = saved_align_state;
+ } else {
+ back_input();
+ }
cur_cs = save_cur_cs;
- back_input();
return false;
}
- } else {
- p = backup_head;
- token_link(p) = null;
- k = s;
- while (*k) {
- get_x_token(); /* recursion is possible here */
- if ((cur_cs == 0) &&
- ((cur_chr == *k) || (cur_chr == *k - 'a' + 'A'))) {
- store_new_token(cur_tok);
- k++;
- } else if ((cur_cmd != spacer_cmd) || (p != backup_head)) {
- if (p != backup_head) {
- q = get_avail();
- token_info(q) = cur_tok;
- token_link(q) = null;
- token_link(p) = q;
- begin_token_list(token_link(backup_head), backed_up);
- } else {
- back_input();
- }
- cur_cs = save_cur_cs;
- return false;
- }
- }
- flush_list(token_link(backup_head));
}
+ flush_list(token_link(backup_head));
cur_cs = save_cur_cs;
+ if (cur_cmd != endv_cmd)
+ align_state = saved_align_state;
return true;
}
@@ -949,10 +941,6 @@ static boolean get_next_file(void)
break;
}
} else {
- if (current_ocp_lstack > 0) {
- pop_input();
- return false;
- }
if (iname != 21)
istate = new_line;
@@ -1812,7 +1800,7 @@ void conv_toks(void)
break;
case pdf_xform_name_code:
scan_int();
- check_obj_exists(static_pdf, obj_type_xform, cur_val);
+ check_obj_type(static_pdf, obj_type_xform, cur_val);
break;
case pdf_creation_date_code:
ins_list(string_to_toks(getcreationdate(static_pdf)));
@@ -1920,7 +1908,7 @@ void conv_toks(void)
break;
case pdf_ximage_bbox_code:
scan_int();
- check_obj_exists(static_pdf, obj_type_ximage, cur_val);
+ check_obj_type(static_pdf, obj_type_ximage, cur_val);
i = obj_data_ptr(static_pdf, cur_val);
scan_int();
j = cur_val;