diff options
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/tex')
30 files changed, 171 insertions, 81 deletions
diff --git a/Build/source/texk/web2c/luatexdir/tex/align.w b/Build/source/texk/web2c/luatexdir/tex/align.w index de80cc0a093..1e5c48cc0c4 100644 --- a/Build/source/texk/web2c/luatexdir/tex/align.w +++ b/Build/source/texk/web2c/luatexdir/tex/align.w @@ -21,7 +21,7 @@ @ @c static const char _svn_version[] = - "$Id: align.w 4956 2014-03-28 12:12:17Z luigi $" + "$Id: align.w 5081 2014-11-07 18:38:33Z luigi $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/align.w $"; #include "ptexlib.h" @@ -1135,6 +1135,7 @@ value is changed to zero and so is the next tabskip. if (cur_list.mode_field == mmode) { finish_display_alignment(p, q, pd); } else { + cur_list.prev_depth_field = pd; /* aux:=aux_save; */ vlink(cur_list.tail_field) = p; if (p != null) cur_list.tail_field = q; diff --git a/Build/source/texk/web2c/luatexdir/tex/arithmetic.w b/Build/source/texk/web2c/luatexdir/tex/arithmetic.w index 1c84167ced5..5606aa641ec 100644 --- a/Build/source/texk/web2c/luatexdir/tex/arithmetic.w +++ b/Build/source/texk/web2c/luatexdir/tex/arithmetic.w @@ -21,8 +21,8 @@ @ @c static const char _svn_version[] = - "$Id: arithmetic.w 4634 2013-04-21 14:45:45Z hhenkel $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/arithmetic.w $"; + "$Id: arithmetic.w 4593 2013-03-19 14:25:17Z taco $" + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/arithmetic.w $"; #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/conditional.w b/Build/source/texk/web2c/luatexdir/tex/conditional.w index bcea19201a2..16092a491da 100644 --- a/Build/source/texk/web2c/luatexdir/tex/conditional.w +++ b/Build/source/texk/web2c/luatexdir/tex/conditional.w @@ -20,7 +20,7 @@ @ @c static const char _svn_version[] = "$Id: conditional.w 4442 2012-05-25 22:40:34Z hhenkel $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/conditional.w $"; + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/conditional.w $"; #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/dumpdata.w b/Build/source/texk/web2c/luatexdir/tex/dumpdata.w index 718d6b7fb17..46913bce3a8 100644 --- a/Build/source/texk/web2c/luatexdir/tex/dumpdata.w +++ b/Build/source/texk/web2c/luatexdir/tex/dumpdata.w @@ -19,14 +19,21 @@ @ @c static const char _svn_version[] = - "$Id: dumpdata.w 4563 2013-01-21 03:22:53Z khaled $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/dumpdata.w $"; + "$Id: dumpdata.w 5081 2014-11-07 18:38:33Z luigi $" + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/dumpdata.w $"; #include "ptexlib.h" #define font_id_text(A) cs_text(font_id_base+(A)) #define prev_depth cur_list.prev_depth_field +/* 907 = sum of the values of the bytes of "don knuth" */ +/* The next FORMAT_ID will be 907+1 */ +#define FORMAT_ID (907+0) +#if ((FORMAT_ID>=0) && (FORMAT_ID<=256)) +#error Wrong value for FORMAT_ID. +#endif + @ After \.{INITEX} has seen a collection of fonts and macros, it can write all the necessary information on an auxiliary file so @@ -42,8 +49,10 @@ after the |banner| line when \TeX\ is ready to start. For \.{INITEX} this string says simply `\.{(INITEX)}'; for other versions of \TeX\ it says, for example, `\.{(preloaded format=plain 1982.11.19)}', showing the year, month, and day that the format file was created. We have |format_ident=0| -before \TeX's tables are loaded. - +before \TeX's tables are loaded. |FORMAT_ID| is a new field of type int +suitable for the identification of a format: values between 0 and 256 +(included) can not be used because in the previous format they are used +for the length of the name of the engine. @c str_number format_ident; str_number format_name; /* principal file name */ @@ -114,6 +123,8 @@ void store_fmt_file(void) dump/undump macros. */ dump_int(0x57325458); /* Web2C \TeX's magic constant: "W2TX" */ + dump_int(FORMAT_ID); + /* Align engine to 4 bytes with one or more trailing NUL */ x = (int) strlen(engine_name); format_engine = xmalloc((unsigned) (x + 4)); @@ -368,11 +379,17 @@ boolean load_fmt_file(const char *fmtname) format_debug("format magic number", x); if (x != 0x57325458) goto BAD_FMT; /* not a format file */ + + undump_int(x); + format_debug("format id", x); + if (x != FORMAT_ID) + goto BAD_FMT; /* FORMAT_ID mismatch */ + undump_int(x); format_debug("engine name size", x); if ((x < 0) || (x > 256)) goto BAD_FMT; /* corrupted format file */ - + format_engine = xmalloc((unsigned) x); undump_things(format_engine[0], x); format_engine[x - 1] = 0; /* force string termination, just in case */ diff --git a/Build/source/texk/web2c/luatexdir/tex/equivalents.w b/Build/source/texk/web2c/luatexdir/tex/equivalents.w index 74465213702..3c948634f98 100644 --- a/Build/source/texk/web2c/luatexdir/tex/equivalents.w +++ b/Build/source/texk/web2c/luatexdir/tex/equivalents.w @@ -20,7 +20,7 @@ @ @c static const char _svn_version[] = "$Id: equivalents.w 4442 2012-05-25 22:40:34Z hhenkel $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/equivalents.w $"; + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/equivalents.w $"; #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/errors.h b/Build/source/texk/web2c/luatexdir/tex/errors.h index e0ea6e671ad..537bea562da 100644 --- a/Build/source/texk/web2c/luatexdir/tex/errors.h +++ b/Build/source/texk/web2c/luatexdir/tex/errors.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: errors.h 4956 2014-03-28 12:12:17Z luigi $ */ +/* $Id: errors.h 5081 2014-11-07 18:38:33Z luigi $ */ #ifndef ERRORS_H # define ERRORS_H @@ -97,6 +97,7 @@ extern void tex_error(const char *msg, const char **hlp); extern void back_error(void); extern void ins_error(void); +extern void flush_err(void); extern void char_warning(internal_font_number f, int c); diff --git a/Build/source/texk/web2c/luatexdir/tex/errors.w b/Build/source/texk/web2c/luatexdir/tex/errors.w index 120d44b8a3c..eab33d9c809 100644 --- a/Build/source/texk/web2c/luatexdir/tex/errors.w +++ b/Build/source/texk/web2c/luatexdir/tex/errors.w @@ -19,7 +19,7 @@ @ @c static const char _svn_version[] = - "$Id: errors.w 4956 2014-03-28 12:12:17Z luigi $" + "$Id: errors.w 5081 2014-11-07 18:38:33Z luigi $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/errors.w $"; #include "ptexlib.h" @@ -60,7 +60,7 @@ char *last_error = NULL; int err_old_setting = 0 ; int in_error = 0 ; -static void flush_err(void) +void flush_err(void) { str_number s_error; char *s = NULL; diff --git a/Build/source/texk/web2c/luatexdir/tex/expand.w b/Build/source/texk/web2c/luatexdir/tex/expand.w index 60e1e05686c..d00d84e128d 100644 --- a/Build/source/texk/web2c/luatexdir/tex/expand.w +++ b/Build/source/texk/web2c/luatexdir/tex/expand.w @@ -20,7 +20,7 @@ @ @c static const char _svn_version[] = "$Id: expand.w 4442 2012-05-25 22:40:34Z hhenkel $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/expand.w $"; + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/expand.w $"; #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/extensions.w b/Build/source/texk/web2c/luatexdir/tex/extensions.w index 99d6b77697b..41f709d3e29 100644 --- a/Build/source/texk/web2c/luatexdir/tex/extensions.w +++ b/Build/source/texk/web2c/luatexdir/tex/extensions.w @@ -23,7 +23,7 @@ @ @c static const char _svn_version[] = "$Id: extensions.w 4519 2012-12-14 09:11:19Z taco $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/extensions.w $"; + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/extensions.w $"; #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/filename.w b/Build/source/texk/web2c/luatexdir/tex/filename.w index 697f413f2fa..95a94a75074 100644 --- a/Build/source/texk/web2c/luatexdir/tex/filename.w +++ b/Build/source/texk/web2c/luatexdir/tex/filename.w @@ -19,8 +19,8 @@ @ @c static const char _svn_version[] = - "$Id: filename.w 4442 2012-05-25 22:40:34Z hhenkel $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/filename.w $"; + "$Id: filename.w 5081 2014-11-07 18:38:33Z luigi $" + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/filename.w $"; #include "ptexlib.h" @@ -236,6 +236,7 @@ char *prompt_file_name(const char *s, const char *e) { int k; /* index into |buffer| */ str_number saved_cur_name; /* to catch empty terminal input */ + int callback_id ; char prompt[256]; char *ar, *na, *ex; saved_cur_name = cur_name; @@ -254,10 +255,16 @@ char *prompt_file_name(const char *s, const char *e) free(na); free(ex); print_err(prompt); - if ((strcmp(e, ".tex") == 0) || (strcmp(e, "") == 0)) - show_context(); - if (strcmp(s, "input file name") == 0) - tprint_nl(promptfilenamehelpmsg ")"); + callback_id = callback_defined(show_error_hook_callback); + if (callback_id > 0) { + flush_err(); + run_callback(callback_id, "->"); + } else { + if ((strcmp(e, ".tex") == 0) || (strcmp(e, "") == 0)) + show_context(); + if (strcmp(s, "input file name") == 0) + tprint_nl(promptfilenamehelpmsg ")"); + } tprint_nl("Please type another "); tprint(s); if (interaction < scroll_mode) @@ -283,6 +290,7 @@ char *prompt_file_name(const char *s, const char *e) return pack_file_name(cur_name, cur_area, cur_ext); } + @ @c void tprint_file_name(unsigned char *n, unsigned char *a, unsigned char *e) { diff --git a/Build/source/texk/web2c/luatexdir/tex/inputstack.w b/Build/source/texk/web2c/luatexdir/tex/inputstack.w index 136d9507c03..2fc5628e251 100644 --- a/Build/source/texk/web2c/luatexdir/tex/inputstack.w +++ b/Build/source/texk/web2c/luatexdir/tex/inputstack.w @@ -20,7 +20,7 @@ @ @c static const char _svn_version[] = "$Id: inputstack.w 4442 2012-05-25 22:40:34Z hhenkel $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/inputstack.w $"; + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/inputstack.w $"; #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/linebreak.w b/Build/source/texk/web2c/luatexdir/tex/linebreak.w index 646676bcfa2..fd486c3367e 100644 --- a/Build/source/texk/web2c/luatexdir/tex/linebreak.w +++ b/Build/source/texk/web2c/luatexdir/tex/linebreak.w @@ -19,7 +19,7 @@ @ @c static const char _svn_version[] = - "$Id: linebreak.w 4775 2014-02-07 12:36:34Z luigi $" + "$Id: linebreak.w 4777 2014-02-10 10:09:39Z luigi $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/linebreak.w $"; #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/maincontrol.w b/Build/source/texk/web2c/luatexdir/tex/maincontrol.w index 5ee630dc24d..05b842217a5 100644 --- a/Build/source/texk/web2c/luatexdir/tex/maincontrol.w +++ b/Build/source/texk/web2c/luatexdir/tex/maincontrol.w @@ -19,7 +19,7 @@ @ @c static const char _svn_version[] = - "$Id: maincontrol.w 4956 2014-03-28 12:12:17Z luigi $" + "$Id: maincontrol.w 5011 2014-05-26 08:05:55Z khaled $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/maincontrol.w $"; #include "ptexlib.h" @@ -2798,19 +2798,15 @@ void assign_internal_value(int a, halfword p, int val) if (val > 127) { print_err("Invalid \\newlinechar"); help2 - ("The value for \\newlinechar has to be between 0 and 127.", + ("The value for \\newlinechar has to be no higher than 127.", "Your invalid assignment will be ignored."); error(); - } else if (val < 0) { - word_define(p, -1); } else { word_define(p, val); } break; case end_line_char_code: - if (val < 0) { - word_define(p, -1); - } else if (val > 127) { + if (val > 127) { print_err("Invalid \\endlinechar"); help2 ("The value for \\endlinechar has to be no higher than 127.", diff --git a/Build/source/texk/web2c/luatexdir/tex/mathcodes.w b/Build/source/texk/web2c/luatexdir/tex/mathcodes.w index 1603365bc2c..7092dace012 100644 --- a/Build/source/texk/web2c/luatexdir/tex/mathcodes.w +++ b/Build/source/texk/web2c/luatexdir/tex/mathcodes.w @@ -21,7 +21,7 @@ @ @c static const char _svn_version[] = "$Id: mathcodes.w 4562 2013-01-21 02:58:59Z khaled $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/mathcodes.w $"; + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/mathcodes.w $"; #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/memoryword.h b/Build/source/texk/web2c/luatexdir/tex/memoryword.h index 8c44a7e4e0d..6f9cfa393b1 100644 --- a/Build/source/texk/web2c/luatexdir/tex/memoryword.h +++ b/Build/source/texk/web2c/luatexdir/tex/memoryword.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: memoryword.h 3352 2010-01-10 15:35:31Z hhenkel $ */ +/* $Id: memoryword.h 5031 2014-07-04 07:16:27Z luigi $ */ /* This header file is extra special because it is read in from within the pascal source */ @@ -123,7 +123,7 @@ typedef union { typedef FILE *word_file; # ifdef DEBUG -extern procedure print_word(memory_word w); +extern void print_word(memory_word w); # endif #endif diff --git a/Build/source/texk/web2c/luatexdir/tex/memoryword.w b/Build/source/texk/web2c/luatexdir/tex/memoryword.w index 339e094bb2c..d3002f1b2b6 100644 --- a/Build/source/texk/web2c/luatexdir/tex/memoryword.w +++ b/Build/source/texk/web2c/luatexdir/tex/memoryword.w @@ -20,7 +20,7 @@ @ @c static const char _svn_version[] = "$Id: memoryword.w 4442 2012-05-25 22:40:34Z hhenkel $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/memoryword.w $"; + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/memoryword.w $"; #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/mlist.w b/Build/source/texk/web2c/luatexdir/tex/mlist.w index 3621d9f64b6..e653c07c6f0 100644 --- a/Build/source/texk/web2c/luatexdir/tex/mlist.w +++ b/Build/source/texk/web2c/luatexdir/tex/mlist.w @@ -24,7 +24,7 @@ @ @c static const char _svn_version[] = - "$Id: mlist.w 4804 2014-02-12 14:41:14Z luigi $" + "$Id: mlist.w 5033 2014-07-05 00:36:59Z luigi $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/mlist.w $"; #include "ptexlib.h" @@ -1021,6 +1021,7 @@ try_couple_nodes(p,list_ptr(b)); } } + static void stack_glue_into_box(pointer b, scaled min, scaled max) { pointer p, q; /* new node placed into |b| */ q = new_spec(zero_glue); @@ -1029,10 +1030,8 @@ static void stack_glue_into_box(pointer b, scaled min, scaled max) { p = new_glue(q); reset_attributes(p, node_attr(b)); if (type(b) == vlist_node) { -// vlink(p) = list_ptr(b); -try_couple_nodes(p,list_ptr(b)); + try_couple_nodes(p,list_ptr(b)); list_ptr(b) = p; - height(b) = height(p); } else { q = list_ptr(b); if (q == null) { @@ -1042,10 +1041,6 @@ try_couple_nodes(p,list_ptr(b)); q = vlink(q); couple_nodes(q,p); } - if (height(b) < height(p)) - height(b) = height(p); - if (depth(b) < depth(p)) - depth(b) = depth(p); } } @@ -2539,7 +2534,7 @@ static void make_ord(pointer q) type(nucleus(r)) = math_text_char_node; /* prevent combination */ break; default: - couple_nodes(q,vlink(p)); + try_couple_nodes(q,vlink(p)); math_character(nucleus(q)) = lig_replacement(lig); /* \.{=:} */ s = math_clone(subscr(p)); subscr(q) = s; diff --git a/Build/source/texk/web2c/luatexdir/tex/nesting.w b/Build/source/texk/web2c/luatexdir/tex/nesting.w index aa0f32e3324..177901166f4 100644 --- a/Build/source/texk/web2c/luatexdir/tex/nesting.w +++ b/Build/source/texk/web2c/luatexdir/tex/nesting.w @@ -20,7 +20,7 @@ @ @c static const char _svn_version[] = "$Id: nesting.w 4442 2012-05-25 22:40:34Z hhenkel $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/nesting.w $"; + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/nesting.w $"; #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/packaging.w b/Build/source/texk/web2c/luatexdir/tex/packaging.w index d6d02106022..42a87f1ee0d 100644 --- a/Build/source/texk/web2c/luatexdir/tex/packaging.w +++ b/Build/source/texk/web2c/luatexdir/tex/packaging.w @@ -19,7 +19,7 @@ @ @c static const char _svn_version[] = - "$Id: packaging.w 4679 2013-12-19 15:47:53Z luigi $" + "$Id: packaging.w 5023 2014-06-18 08:22:44Z taco $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/packaging.w $"; #include "ptexlib.h" @@ -1216,10 +1216,14 @@ void package(int c) halfword p; /* first node in a box */ scaled d; /* max depth */ int grp; + halfword saved0, saved2, saved3; grp = cur_group; d = box_max_depth; unsave(); save_ptr -= 4; + saved0 = saved_value(0); + saved2 = saved_value(2); + saved3 = saved_value(3); if (cur_list.mode_field == -hmode) { cur_box = filtered_hpack(cur_list.head_field, cur_list.tail_field, saved_value(1), @@ -1246,15 +1250,15 @@ void package(int c) } } - if (saved_value(2) != null) { + if (saved2 != null) { /* DIR: Adjust back |text_dir_ptr| for |scan_spec| */ flush_node_list(text_dir_ptr); - text_dir_ptr = saved_value(2); + text_dir_ptr = saved2; } - replace_attribute_list(cur_box, saved_value(3)); + replace_attribute_list(cur_box, saved3); pop_nest(); - box_end(saved_value(0)); + box_end(saved0); } diff --git a/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w b/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w index ef769f7a357..d7990ca52c0 100644 --- a/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w +++ b/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w @@ -19,7 +19,7 @@ @ @c static const char _svn_version[] = - "$Id: postlinebreak.w 4956 2014-03-28 12:12:17Z luigi $" + "$Id: postlinebreak.w 5081 2014-11-07 18:38:33Z luigi $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/postlinebreak.w $"; #include "ptexlib.h" @@ -98,7 +98,7 @@ void ext_post_line_break(int paragraph_dir, halfword cur_line; /*the current line number being justified */ dir_ptr = cur_list.dirs_field; - /* Reverse the links of the relevant passive nodes, setting |cur_p| to + /* Reverse the links of the relevant passive nodes, setting |cur_p| to the first breakpoint; */ /* The job of reversing links in a list is conveniently regarded as the job of taking items off one stack and putting them on another. In this case we @@ -108,7 +108,7 @@ void ext_post_line_break(int paragraph_dir, */ q = break_node(best_bet); #if 0 - used_discs = used_disc(best_bet); + used_discs = used_disc(best_bet); #endif /* |has_direction| */ cur_p = null; @@ -530,17 +530,78 @@ void ext_post_line_break(int paragraph_dir, |break_width| values are computed for non-discretionary breakpoints. */ r = temp_head; - while (1) { - q = vlink(r); - if (q == cur_break(cur_p) || is_char_node(q)) - break; - if (!((type(q) == whatsit_node) - && (subtype(q) == local_par_node))) { - if (non_discardable(q) - || (type(q) == kern_node && subtype(q) != explicit)) + if (experimental_code[1]) { + /* hh-ls: This is a first step to improving symmetry and consistency in the node + list. This is normally no issue in tex, but in callbacks it matters. */ + + /* Normally we have a matching math open and math close node but when we cross a line + the open node is removed, including any glue or penalties following it. This is however + not that nice for callbacks that rely on symmetry. Of course this only counts for one + liners, as we can still have only a begin or end node on a line. The end_of_math lua + helper is made robust against this although there you should be aware of the fact that + one can end up in the middle of math in callbacks that don't work on whole paragraphs, + but at least this branch makes sure that some proper analysis is possible. (todo: check + if math glyphs have the subtype marked done). */ + + halfword m = null ; + halfword mp, mn, rn ; + while (1) { + q = vlink(r); + if (! q) { + /* unlikely */ break; + } else if (q == cur_break(cur_p)) { + /* quit */ + break; + } else if (type(q) == glyph_node) { + /* quit: is > math_code */ + break; + } else if (type(q) == math_node) { + /* we want to keep symmetry */ + surround(q) = 0 ; + // fprintf(stdout,"KEEP MATH NODE\n"); + m = q ; + } else if (type(q) == kern_node && subtype(q) != explicit) { + /* quit: so we keep \kern but also auto kerns */ + break; + } if (non_discardable(q)) { + /* quit: < math_node */ + break; + } else { + /* skip: glue, penalty, (font)kern, noads, temp stuff, all kind of left-overs */ + } + r = q; + } + if (m != null) { + if (r == m) { + /* [a] [b] [m=r] => [a] [b=r] */ + r = alink(m) ; + } else { + /* [a] [b] [m] [c] [r] [rn] => [a] [b] [c] [r] [m] [rn] */ + mp = alink(m) ; + mn = vlink(m) ; + rn = vlink(r) ; + vlink(r) = m ; + alink(m) = r ; + if (rn) { + alink(rn) = m ; + vlink(m) = rn ; + } + vlink(mp) = mn ; + alink(mn) = mp ; + } + } + } else { + while (1) { + q = vlink(r); + if (q == cur_break(cur_p) || is_char_node(q)) + break; + if (!((type(q) == whatsit_node) && (subtype(q) == local_par_node))) { + if (non_discardable(q) || (type(q) == kern_node && subtype(q) != explicit)) + break; + } + r = q; } - r = q; } if (r != temp_head) { vlink(r) = null; diff --git a/Build/source/texk/web2c/luatexdir/tex/primitive.w b/Build/source/texk/web2c/luatexdir/tex/primitive.w index ab983cfe346..e02ae1a7735 100644 --- a/Build/source/texk/web2c/luatexdir/tex/primitive.w +++ b/Build/source/texk/web2c/luatexdir/tex/primitive.w @@ -20,7 +20,7 @@ @ @c static const char _svn_version[] = "$Id: primitive.w 4562 2013-01-21 02:58:59Z khaled $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/primitive.w $"; + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/primitive.w $"; #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/printing.h b/Build/source/texk/web2c/luatexdir/tex/printing.h index e664c51d720..057ed422b95 100644 --- a/Build/source/texk/web2c/luatexdir/tex/printing.h +++ b/Build/source/texk/web2c/luatexdir/tex/printing.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: printing.h 4722 2014-01-03 09:32:35Z taco $ */ +/* $Id: printing.h 5002 2014-05-20 09:14:16Z taco $ */ #ifndef PRINTING_H # define PRINTING_H @@ -60,6 +60,7 @@ by changing |wterm|, |wterm_ln|, and |wterm_cr| in this section. extern void print_ln(void); extern void print_char(int s); extern void print(int s); +extern void lprint (lstring *ss); extern void print_nl(str_number s); extern void print_nlp(void); extern void print_banner(const char *, int); diff --git a/Build/source/texk/web2c/luatexdir/tex/printing.w b/Build/source/texk/web2c/luatexdir/tex/printing.w index 9b2404c0196..ce64d1e829c 100644 --- a/Build/source/texk/web2c/luatexdir/tex/printing.w +++ b/Build/source/texk/web2c/luatexdir/tex/printing.w @@ -19,7 +19,7 @@ @ @c static const char _svn_version[] = - "$Id: printing.w 4857 2014-03-07 00:01:41Z luigi $" + "$Id: printing.w 5081 2014-11-07 18:38:33Z luigi $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/printing.w $"; #include "ptexlib.h" @@ -226,8 +226,6 @@ to do the same substraction while typesetting. @c void print(int s) { /* prints string |s| */ - unsigned char *j, *l; /* current character code position */ - if (s >= str_ptr) { /* this can't happen */ print_char('?'); @@ -285,8 +283,13 @@ void print(int s) append_string(str_string(s), (unsigned) str_length(s)); return; } - j = str_string(s); - l = j + str_length(s); + lprint(&str_lstring(s)); +} + +void lprint (lstring *ss) { + unsigned char *j, *l; /* current character code position */ + j = ss->s; + l = j + ss->l; while (j < l) { /* 0x110000 in utf=8: 0xF4 0x90 0x80 0x80 */ /* I don't bother checking the last two bytes explicitly */ @@ -302,7 +305,6 @@ void print(int s) } } - @ The procedure |print_nl| is like |print|, but it makes sure that the string appears at the beginning of a new line. @@ -339,8 +341,9 @@ void tprint(const char *sss) break; case pseudo: while (*sss) { - if (tally++ < trick_count) { + if (tally < trick_count) { trick_buf[tally % error_line] = (packed_ASCII_code) *sss++; + tally++; } else { return; } diff --git a/Build/source/texk/web2c/luatexdir/tex/scanning.w b/Build/source/texk/web2c/luatexdir/tex/scanning.w index f3cc9b29bb5..7e2283a92cc 100644 --- a/Build/source/texk/web2c/luatexdir/tex/scanning.w +++ b/Build/source/texk/web2c/luatexdir/tex/scanning.w @@ -19,7 +19,7 @@ @ @c static const char _svn_version[] = - "$Id: scanning.w 4877 2014-03-14 01:26:05Z luigi $" + "$Id: scanning.w 5009 2014-05-26 07:49:59Z taco $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/scanning.w $"; #include "ptexlib.h" @@ -2089,7 +2089,7 @@ halfword scan_toks(boolean macro_def, boolean xpand) sprint_cs(warning_index); help3("You meant to type ## instead of #, right?", "Or maybe a } was forgotten somewhere earlier, and things", - "are all screwed up? I''m going to assume that you meant ##."); + "are all screwed up? I'm going to assume that you meant ##."); back_error(); cur_tok = s; } else { diff --git a/Build/source/texk/web2c/luatexdir/tex/stringpool.h b/Build/source/texk/web2c/luatexdir/tex/stringpool.h index 136e5cdb758..d9a33fe102d 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 4634 2013-04-21 14:45:45Z hhenkel $ */ +/* $Id: stringpool.h 4599 2013-03-19 15:41:07Z taco $ */ #ifndef STRINGPOOL_H # define STRINGPOOL_H diff --git a/Build/source/texk/web2c/luatexdir/tex/stringpool.w b/Build/source/texk/web2c/luatexdir/tex/stringpool.w index 4df0c53c54b..990c619d7f2 100644 --- a/Build/source/texk/web2c/luatexdir/tex/stringpool.w +++ b/Build/source/texk/web2c/luatexdir/tex/stringpool.w @@ -19,8 +19,8 @@ @ @c static const char _svn_version[] = - "$Id: stringpool.w 4634 2013-04-21 14:45:45Z hhenkel $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/stringpool.w $"; + "$Id: stringpool.w 4599 2013-03-19 15:41:07Z taco $" + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/stringpool.w $"; #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/texdeffont.w b/Build/source/texk/web2c/luatexdir/tex/texdeffont.w index 2766c4b4cd7..174a1ba86dc 100644 --- a/Build/source/texk/web2c/luatexdir/tex/texdeffont.w +++ b/Build/source/texk/web2c/luatexdir/tex/texdeffont.w @@ -20,7 +20,7 @@ @ @c static const char _svn_version[] = "$Id: texdeffont.w 4520 2012-12-14 09:15:55Z taco $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/texdeffont.w $"; + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/texdeffont.w $"; #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/texmath.w b/Build/source/texk/web2c/luatexdir/tex/texmath.w index 527be959082..428e5001304 100644 --- a/Build/source/texk/web2c/luatexdir/tex/texmath.w +++ b/Build/source/texk/web2c/luatexdir/tex/texmath.w @@ -19,7 +19,7 @@ @ @c static const char _svn_version[] = - "$Id: texmath.w 4956 2014-03-28 12:12:17Z luigi $" + "$Id: texmath.w 5081 2014-11-07 18:38:33Z luigi $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/texmath.w $"; #include "ptexlib.h" @@ -1418,7 +1418,10 @@ void math_limit_switch(void) NULL }; if (head != tail) { - if (type(tail) == simple_noad) { + if (type(tail) == simple_noad && + (subtype(tail) == op_noad_type_normal || + subtype(tail) == op_noad_type_limits || + subtype(tail) == op_noad_type_no_limits)) { subtype(tail) = (quarterword) cur_chr; return; } diff --git a/Build/source/texk/web2c/luatexdir/tex/textcodes.w b/Build/source/texk/web2c/luatexdir/tex/textcodes.w index e54aa0f72d0..08d890dfb3d 100644 --- a/Build/source/texk/web2c/luatexdir/tex/textcodes.w +++ b/Build/source/texk/web2c/luatexdir/tex/textcodes.w @@ -20,7 +20,7 @@ @ @c static const char _svn_version[] = "$Id: textcodes.w 4519 2012-12-14 09:11:19Z taco $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/textcodes.w $"; + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/textcodes.w $"; #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/textoken.w b/Build/source/texk/web2c/luatexdir/tex/textoken.w index e9ae2e670a4..d37b85ae6f8 100644 --- a/Build/source/texk/web2c/luatexdir/tex/textoken.w +++ b/Build/source/texk/web2c/luatexdir/tex/textoken.w @@ -19,7 +19,7 @@ @ @c static const char _svn_version[] = - "$Id: textoken.w 4956 2014-03-28 12:12:17Z luigi $" + "$Id: textoken.w 5004 2014-05-20 09:23:31Z taco $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/textoken.w $"; #include "ptexlib.h" @@ -2323,7 +2323,7 @@ char *tokenlist_to_cstring(int pp, int inhibit_par, int *siz) s++; } } else { - Print_uchar(e); + if (e>=0 && e<0x110000) Print_uchar(e); while (*s) { Print_char(*s); s++; |