diff options
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/tex')
44 files changed, 875 insertions, 1041 deletions
diff --git a/Build/source/texk/web2c/luatexdir/tex/align.w b/Build/source/texk/web2c/luatexdir/tex/align.w index 827e2bc07ae..0a58ed02a95 100644 --- a/Build/source/texk/web2c/luatexdir/tex/align.w +++ b/Build/source/texk/web2c/luatexdir/tex/align.w @@ -1,30 +1,30 @@ % align.w -% +% % Copyright 2009-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. \def\<#1>{$#1$} @ @c -#include "ptexlib.h" - static const char _svn_version[] = - "$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 $"; + "$Id: align.w 4442 2012-05-25 22:40:34Z hhenkel $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/align.w $"; + +#include "ptexlib.h" @ @c void fin_align(void); @@ -967,6 +967,7 @@ value is changed to zero and so is the next tabskip. glue_set(q) = glue_set(p); shift_amount(q) = o; r = vlink(list_ptr(q)); + assert (type(r) == unset_node); s = vlink(list_ptr(p)); do { /* Set the glue in node |r| and change it from an unset node */ diff --git a/Build/source/texk/web2c/luatexdir/tex/arithmetic.w b/Build/source/texk/web2c/luatexdir/tex/arithmetic.w index f0f0adb5abd..5606aa641ec 100644 --- a/Build/source/texk/web2c/luatexdir/tex/arithmetic.w +++ b/Build/source/texk/web2c/luatexdir/tex/arithmetic.w @@ -1,31 +1,30 @@ % arithmetic.w -% +% % Copyright 2009-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along -% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. +% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. \def\MP{MetaPost} @ @c -#include "ptexlib.h" - static const char _svn_version[] = - "$Id: arithmetic.w 3587 2010-04-03 14:32:25Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/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" @ The principal computations performed by \TeX\ are done entirely in terms of integers less than $2^{31}$ in magnitude; and divisions are done only when both @@ -92,21 +91,25 @@ terminate before $s$ can possibly become zero. void print_scaled(scaled s) { /* prints scaled real, rounded to five digits */ scaled delta; /* amount of allowable inaccuracy */ + char buffer[20]; + int i = 0; if (s < 0) { print_char('-'); negate(s); /* print the sign, if negative */ } print_int(s / unity); /* print the integer part */ - print_char('.'); + buffer[i++] = '.'; s = 10 * (s % unity) + 5; delta = 10; do { if (delta > unity) s = s + 0100000 - 50000; /* round the last digit */ - print_char('0' + (s / unity)); + buffer[i++] = '0' + (s / unity); s = 10 * (s % unity); delta = delta * 10; } while (s > delta); + buffer[i++] = '\0'; + tprint(buffer); } @ Physical sizes that a \TeX\ user specifies for portions of documents are diff --git a/Build/source/texk/web2c/luatexdir/tex/buildpage.w b/Build/source/texk/web2c/luatexdir/tex/buildpage.w index bc6f61a15dc..3423fa7441a 100644 --- a/Build/source/texk/web2c/luatexdir/tex/buildpage.w +++ b/Build/source/texk/web2c/luatexdir/tex/buildpage.w @@ -1,26 +1,26 @@ % buildpage.w -% +% % Copyright 2009-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c static const char _svn_version[] = - "$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 $"; + "$Id: buildpage.w 4442 2012-05-25 22:40:34Z hhenkel $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/buildpage.w $"; #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/commands.h b/Build/source/texk/web2c/luatexdir/tex/commands.h index 6e3c5ee1d2e..7a2afef788a 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 4000 2010-11-28 13:58:35Z taco $ */ +/* $Id: commands.h 4585 2013-03-01 08:22:51Z taco $ */ #ifndef COMMANDS_H # define COMMANDS_H @@ -149,7 +149,6 @@ typedef enum { # 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 \.{\\Umathchardef} or \.{\\Umathcharnumdef} */ 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} */ @@ -171,8 +170,8 @@ typedef enum { set_etex_shape_cmd, /* specify etex extended list ( \.{\\interlinepenalties}, etc.~) */ def_char_code_cmd, /* define a character code ( \.{\\catcode}, etc.~) */ def_del_code_cmd, /* define a delimiter code ( \.{\\delcode}) */ - extdef_math_code_cmd, /* define an extended character code ( \.{\\omathcode}, etc.~) */ - extdef_del_code_cmd, /* define an extended delimiter code ( \.{\\odelcode}, etc.~) */ + extdef_math_code_cmd, /* define an extended character code ( \.{\\Umathcode}, etc.~) */ + extdef_del_code_cmd, /* define an extended delimiter code ( \.{\\Udelcode}, etc.~) */ def_family_cmd, /* declare math fonts ( \.{\\textfont}, etc.~) */ set_math_param_cmd, /* set math parameters ( \.{\\mathquad}, etc.~) */ set_font_cmd, /* set current font ( font identifiers ) */ @@ -236,8 +235,6 @@ typedef enum { meaning_code, /* command code for \.{\\meaning} */ font_name_code, /* command code for \.{\\fontname} */ etex_code, /* command code for \.{\\eTeXVersion} */ - omega_code, /* command code for \.{\\OmegaVersion} */ - aleph_code, /* command code for \.{\\AlephVersion} */ format_name_code, /* command code for \.{\\AlephVersion} */ pdftex_revision_code, /* command code for \.{\\pdftexrevision} */ # define pdftex_first_expand_code pdftex_revision_code /* base for \pdfTeX's command codes */ @@ -262,10 +259,10 @@ typedef enum { math_style_code, /* command code for \.{\\mathstyle} */ expanded_code, /* command code for \.{\\expanded} */ job_name_code, /* command code for \.{\\jobname} */ - Aleph_revision_code, /* command code for \.{\\Alephrevision} */ - Omega_revision_code, /* command code for \.{\\Omegarevision} */ eTeX_revision_code, /* command code for \.{\\eTeXrevision} */ font_identifier_code, /* command code for \.{tex.fontidentifier} (virtual) */ + font_id_code, /* command code for \.{\\fontid} */ + uchar_code, /* command code for \.{\\Uchar} */ } convert_codes; typedef enum { @@ -290,11 +287,6 @@ typedef enum { random_seed_code, /* code for \.{\\pdfrandomseed} */ pdf_last_link_code, /* code for \.{\\pdflastlink} */ luatex_version_code, /* code for \.{\\luatexversion} */ - Aleph_version_code, /* code for \.{\\Alephversion} */ -# define Aleph_int Aleph_version_code - Omega_version_code, /* code for \.{\\Omegaversion} */ - Aleph_minor_version_code, /* code for \.{\\Alephminorversion} */ - Omega_minor_version_code, /* code for \.{\\Omegaminorversion} */ eTeX_minor_version_code, /* code for \.{\\eTeXminorversion} */ eTeX_version_code, /* code for \.{\\eTeXversion} */ # define eTeX_int eTeX_version_code /* first of \eTeX\ codes for integers */ diff --git a/Build/source/texk/web2c/luatexdir/tex/commands.w b/Build/source/texk/web2c/luatexdir/tex/commands.w index e91c72c4c08..f379d8eae23 100644 --- a/Build/source/texk/web2c/luatexdir/tex/commands.w +++ b/Build/source/texk/web2c/luatexdir/tex/commands.w @@ -1,30 +1,30 @@ % commands.w -% +% % Copyright 2009-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along -% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. +% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. \def\eTeX{e-\TeX} @ @c -#include "ptexlib.h" - static const char _svn_version[] = - "$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 $"; + "$Id: commands.w 4585 2013-03-01 08:22:51Z taco $" + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/commands.w $"; + +#include "ptexlib.h" @ 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 @@ -341,8 +341,7 @@ void initialize_commands(void) primitive_tex("char", char_num_cmd, 0, 0); primitive_tex("csname", cs_name_cmd, 0, 0); primitive_tex("delimiter", delim_num_cmd, 0, 0); - primitive_omega("odelimiter", delim_num_cmd, 1, 0); - primitive_luatex("Udelimiter", delim_num_cmd, 2, 0); + primitive_umath("Udelimiter", delim_num_cmd, 1, 0); primitive_tex("divide", divide_cmd, 0, 0); primitive_tex("endcsname", end_cs_name_cmd, 0, 0); primitive_tex("endgroup", end_group_cmd, 0, 0); @@ -360,16 +359,12 @@ void initialize_commands(void) primitive_omega("leftghost", char_ghost_cmd, 0, 0); primitive_tex("mark", mark_cmd, 0, 0); primitive_tex("mathaccent", math_accent_cmd, 0, 0); - primitive_omega("omathaccent", math_accent_cmd, 1, 0); - primitive_luatex("Umathaccent", math_accent_cmd, 2, 0); - primitive_luatex("Umathbotaccent", math_accent_cmd, 3, 0); - primitive_luatex("Umathaccents", math_accent_cmd, 4, 0); + primitive_umath("Umathaccent", math_accent_cmd, 1, 0); primitive_tex("mathchar", math_char_num_cmd, 0, 0); - primitive_omega("omathchar", math_char_num_cmd, 1, 0); - primitive_luatex("Umathchar", math_char_num_cmd, 2, 0); - primitive_luatex("Umathcharnum", math_char_num_cmd, 3, 0); + primitive_umath("Umathchar", math_char_num_cmd, 1, 0); + primitive_umath("Umathcharnum", math_char_num_cmd, 2, 0); primitive_tex("mathchoice", math_choice_cmd, 0, 0); - primitive_luatex("Ustack", math_choice_cmd, 1, 0); + primitive_umath("Ustack", math_choice_cmd, 1, 0); primitive_tex("multiply", multiply_cmd, 0, 0); primitive_tex("noalign", no_align_cmd, 0, 0); primitive_tex("noboundary", no_boundary_cmd, 0, 0); @@ -382,13 +377,12 @@ void initialize_commands(void) primitive_tex("penalty", break_penalty_cmd, 0, 0); primitive_tex("prevgraf", set_prev_graf_cmd, 0, 0); primitive_tex("radical", radical_cmd, 0, 0); - primitive_omega("oradical", radical_cmd, 1, 0); - primitive_luatex("Uradical", radical_cmd, 2, 0); - primitive_luatex("Uroot", radical_cmd, 3, 0); - primitive_luatex("Uunderdelimiter", radical_cmd, 4, 0); - primitive_luatex("Uoverdelimiter", radical_cmd, 5, 0); - primitive_luatex("Udelimiterunder", radical_cmd, 6, 0); - primitive_luatex("Udelimiterover", radical_cmd, 7, 0); + primitive_umath("Uradical", radical_cmd, 1, 0); + primitive_umath("Uroot", radical_cmd, 2, 0); + primitive_umath("Uunderdelimiter", radical_cmd, 3, 0); + primitive_umath("Uoverdelimiter", radical_cmd, 4, 0); + primitive_umath("Udelimiterunder", radical_cmd, 5, 0); + primitive_umath("Udelimiterover", radical_cmd, 6, 0); primitive_tex("read", read_to_cs_cmd, 0, 0); primitive_tex("relax", relax_cmd, too_big_char, too_big_char); cs_text(frozen_relax) = maketexstring("relax"); @@ -477,9 +471,8 @@ void initialize_commands(void) primitive_tex("string", convert_cmd, string_code, 0); primitive_tex("meaning", convert_cmd, meaning_code, 0); primitive_etex("eTeXVersion", convert_cmd, etex_code, 0); - primitive_omega("OmegaVersion", convert_cmd, omega_code, 0); - primitive_aleph("AlephVersion", convert_cmd, aleph_code, 0); primitive_tex("fontname", convert_cmd, font_name_code, 0); + primitive_luatex("fontid", convert_cmd, font_id_code, 0); primitive_pdftex("pdftexrevision", convert_cmd, pdftex_revision_code, 0); primitive_luatex("luatexrevision", convert_cmd, luatex_revision_code, 0); primitive_luatex("luatexdatestamp", convert_cmd, luatex_date_code, 0); @@ -504,6 +497,7 @@ void initialize_commands(void) primitive_luatex("formatname", convert_cmd, format_name_code, 0); primitive_pdftex("pdfinsertht", convert_cmd, pdf_insert_ht_code, 0); primitive_pdftex("pdfximagebbox", convert_cmd, pdf_ximage_bbox_code, 0); + primitive_luatex("Uchar", convert_cmd, uchar_code, 0); primitive_tex("if", if_test_cmd, if_char_code, 0); primitive_tex("ifcat", if_test_cmd, if_cat_code, 0); @@ -615,10 +609,10 @@ void initialize_commands(void) primitive_omega("localleftbox", assign_local_box_cmd, 0, 0); primitive_omega("localrightbox", assign_local_box_cmd, 1, 0); - primitive_luatex("Ustartmath", math_shift_cs_cmd, text_style, 0); - primitive_luatex("Ustopmath", math_shift_cs_cmd, cramped_text_style, 0); - primitive_luatex("Ustartdisplaymath", math_shift_cs_cmd, display_style, 0); - primitive_luatex("Ustopdisplaymath", math_shift_cs_cmd, + primitive_umath("Ustartmath", math_shift_cs_cmd, text_style, 0); + primitive_umath("Ustopmath", math_shift_cs_cmd, cramped_text_style, 0); + primitive_umath("Ustartdisplaymath", math_shift_cs_cmd, display_style, 0); + primitive_umath("Ustopdisplaymath", math_shift_cs_cmd, cramped_display_style, 0); primitive_tex("eqno", eq_no_cmd, 0, 0); primitive_tex("leqno", eq_no_cmd, 1, 0); @@ -646,9 +640,9 @@ void initialize_commands(void) 0); primitive_luatex("crampedscriptscriptstyle", math_style_cmd, cramped_script_script_style, 0); - primitive_luatex("Usuperscript", super_sub_script_cmd, sup_mark_cmd, + primitive_umath("Usuperscript", super_sub_script_cmd, sup_mark_cmd, sup_mark_cmd); - primitive_luatex("Usubscript", super_sub_script_cmd, sub_mark_cmd, + primitive_umath("Usubscript", super_sub_script_cmd, sub_mark_cmd, sup_mark_cmd); primitive_tex("above", above_cmd, above_code, 0); primitive_tex("over", above_cmd, over_code, 0); @@ -673,9 +667,8 @@ void initialize_commands(void) primitive_tex("futurelet", let_cmd, normal + 1, 0); primitive_tex("chardef", shorthand_def_cmd, char_def_code, 0); primitive_tex("mathchardef", shorthand_def_cmd, math_char_def_code, 0); - primitive_omega("omathchardef", shorthand_def_cmd, omath_char_def_code, 0); - primitive_luatex("Umathchardef", shorthand_def_cmd, xmath_char_def_code, 0); - primitive_luatex("Umathcharnumdef", shorthand_def_cmd, umath_char_def_code, 0); + primitive_umath("Umathchardef", shorthand_def_cmd, xmath_char_def_code, 0); + primitive_umath("Umathcharnumdef", shorthand_def_cmd, umath_char_def_code, 0); primitive_tex("countdef", shorthand_def_cmd, count_def_code, 0); primitive_luatex("attributedef", shorthand_def_cmd, attribute_def_code, 0); primitive_tex("dimendef", shorthand_def_cmd, dimen_def_code, 0); @@ -691,242 +684,238 @@ void initialize_commands(void) primitive_tex("textfont", def_family_cmd, text_size, 0); primitive_tex("scriptfont", def_family_cmd, script_size, 0); primitive_tex("scriptscriptfont", def_family_cmd, script_script_size, 0); - primitive_luatex("Umathquad", set_math_param_cmd, math_param_quad, 0); - primitive_luatex("Umathaxis", set_math_param_cmd, math_param_axis, 0); + primitive_umath("Umathquad", set_math_param_cmd, math_param_quad, 0); + primitive_umath("Umathaxis", set_math_param_cmd, math_param_axis, 0); @ These are in a separate module due to a CWEAVE limitation. @<Create the math param primitives@>= - primitive_luatex("Umathoperatorsize", set_math_param_cmd, + primitive_umath("Umathoperatorsize", set_math_param_cmd, math_param_operator_size, 0); - primitive_luatex("Umathoverbarkern", set_math_param_cmd, + primitive_umath("Umathoverbarkern", set_math_param_cmd, math_param_overbar_kern, 0); - primitive_luatex("Umathoverbarrule", set_math_param_cmd, + primitive_umath("Umathoverbarrule", set_math_param_cmd, math_param_overbar_rule, 0); - primitive_luatex("Umathoverbarvgap", set_math_param_cmd, + primitive_umath("Umathoverbarvgap", set_math_param_cmd, math_param_overbar_vgap, 0); - primitive_luatex("Umathunderbarkern", set_math_param_cmd, + primitive_umath("Umathunderbarkern", set_math_param_cmd, math_param_underbar_kern, 0); - primitive_luatex("Umathunderbarrule", set_math_param_cmd, + primitive_umath("Umathunderbarrule", set_math_param_cmd, math_param_underbar_rule, 0); - primitive_luatex("Umathunderbarvgap", set_math_param_cmd, + primitive_umath("Umathunderbarvgap", set_math_param_cmd, math_param_underbar_vgap, 0); - primitive_luatex("Umathradicalkern", set_math_param_cmd, + primitive_umath("Umathradicalkern", set_math_param_cmd, math_param_radical_kern, 0); - primitive_luatex("Umathradicalrule", set_math_param_cmd, + primitive_umath("Umathradicalrule", set_math_param_cmd, math_param_radical_rule, 0); - primitive_luatex("Umathradicalvgap", set_math_param_cmd, + primitive_umath("Umathradicalvgap", set_math_param_cmd, math_param_radical_vgap, 0); - primitive_luatex("Umathradicaldegreebefore", set_math_param_cmd, + primitive_umath("Umathradicaldegreebefore", set_math_param_cmd, math_param_radical_degree_before, 0); - primitive_luatex("Umathradicaldegreeafter", set_math_param_cmd, + primitive_umath("Umathradicaldegreeafter", set_math_param_cmd, math_param_radical_degree_after, 0); - primitive_luatex("Umathradicaldegreeraise", set_math_param_cmd, + primitive_umath("Umathradicaldegreeraise", set_math_param_cmd, math_param_radical_degree_raise, 0); - primitive_luatex("Umathstackvgap", set_math_param_cmd, + primitive_umath("Umathstackvgap", set_math_param_cmd, math_param_stack_vgap, 0); - primitive_luatex("Umathstacknumup", set_math_param_cmd, + primitive_umath("Umathstacknumup", set_math_param_cmd, math_param_stack_num_up, 0); - primitive_luatex("Umathstackdenomdown", set_math_param_cmd, + primitive_umath("Umathstackdenomdown", set_math_param_cmd, math_param_stack_denom_down, 0); - primitive_luatex("Umathfractionrule", set_math_param_cmd, + primitive_umath("Umathfractionrule", set_math_param_cmd, math_param_fraction_rule, 0); - primitive_luatex("Umathfractionnumvgap", set_math_param_cmd, + primitive_umath("Umathfractionnumvgap", set_math_param_cmd, math_param_fraction_num_vgap, 0); - primitive_luatex("Umathfractionnumup", set_math_param_cmd, + primitive_umath("Umathfractionnumup", set_math_param_cmd, math_param_fraction_num_up, 0); - primitive_luatex("Umathfractiondenomvgap", set_math_param_cmd, + primitive_umath("Umathfractiondenomvgap", set_math_param_cmd, math_param_fraction_denom_vgap, 0); - primitive_luatex("Umathfractiondenomdown", set_math_param_cmd, + primitive_umath("Umathfractiondenomdown", set_math_param_cmd, math_param_fraction_denom_down, 0); - primitive_luatex("Umathfractiondelsize", set_math_param_cmd, + primitive_umath("Umathfractiondelsize", set_math_param_cmd, math_param_fraction_del_size, 0); - primitive_luatex("Umathlimitabovevgap", set_math_param_cmd, + primitive_umath("Umathlimitabovevgap", set_math_param_cmd, math_param_limit_above_vgap, 0); - primitive_luatex("Umathlimitabovebgap", set_math_param_cmd, + primitive_umath("Umathlimitabovebgap", set_math_param_cmd, math_param_limit_above_bgap, 0); - primitive_luatex("Umathlimitabovekern", set_math_param_cmd, + primitive_umath("Umathlimitabovekern", set_math_param_cmd, math_param_limit_above_kern, 0); - primitive_luatex("Umathlimitbelowvgap", set_math_param_cmd, + primitive_umath("Umathlimitbelowvgap", set_math_param_cmd, math_param_limit_below_vgap, 0); - primitive_luatex("Umathlimitbelowbgap", set_math_param_cmd, + primitive_umath("Umathlimitbelowbgap", set_math_param_cmd, math_param_limit_below_bgap, 0); - primitive_luatex("Umathlimitbelowkern", set_math_param_cmd, + primitive_umath("Umathlimitbelowkern", set_math_param_cmd, math_param_limit_below_kern, 0); - primitive_luatex("Umathunderdelimitervgap", set_math_param_cmd, + primitive_umath("Umathunderdelimitervgap", set_math_param_cmd, math_param_under_delimiter_vgap, 0); - primitive_luatex("Umathunderdelimiterbgap", set_math_param_cmd, + primitive_umath("Umathunderdelimiterbgap", set_math_param_cmd, math_param_under_delimiter_bgap, 0); - primitive_luatex("Umathoverdelimitervgap", set_math_param_cmd, + primitive_umath("Umathoverdelimitervgap", set_math_param_cmd, math_param_over_delimiter_vgap, 0); - primitive_luatex("Umathoverdelimiterbgap", set_math_param_cmd, + primitive_umath("Umathoverdelimiterbgap", set_math_param_cmd, math_param_over_delimiter_bgap, 0); - primitive_luatex("Umathsubshiftdrop", set_math_param_cmd, + primitive_umath("Umathsubshiftdrop", set_math_param_cmd, math_param_sub_shift_drop, 0); - primitive_luatex("Umathsupshiftdrop", set_math_param_cmd, + primitive_umath("Umathsupshiftdrop", set_math_param_cmd, math_param_sup_shift_drop, 0); - primitive_luatex("Umathsubshiftdown", set_math_param_cmd, + primitive_umath("Umathsubshiftdown", set_math_param_cmd, math_param_sub_shift_down, 0); - primitive_luatex("Umathsubsupshiftdown", set_math_param_cmd, + primitive_umath("Umathsubsupshiftdown", set_math_param_cmd, math_param_sub_sup_shift_down, 0); - primitive_luatex("Umathsubtopmax", set_math_param_cmd, + primitive_umath("Umathsubtopmax", set_math_param_cmd, math_param_sub_top_max, 0); - primitive_luatex("Umathsupshiftup", set_math_param_cmd, + primitive_umath("Umathsupshiftup", set_math_param_cmd, math_param_sup_shift_up, 0); - primitive_luatex("Umathsupbottommin", set_math_param_cmd, + primitive_umath("Umathsupbottommin", set_math_param_cmd, math_param_sup_bottom_min, 0); - primitive_luatex("Umathsupsubbottommax", set_math_param_cmd, + primitive_umath("Umathsupsubbottommax", set_math_param_cmd, math_param_sup_sub_bottom_max, 0); - primitive_luatex("Umathsubsupvgap", set_math_param_cmd, + primitive_umath("Umathsubsupvgap", set_math_param_cmd, math_param_subsup_vgap, 0); - primitive_luatex("Umathspaceafterscript", set_math_param_cmd, + primitive_umath("Umathspaceafterscript", set_math_param_cmd, math_param_space_after_script, 0); - primitive_luatex("Umathconnectoroverlapmin", set_math_param_cmd, + primitive_umath("Umathconnectoroverlapmin", set_math_param_cmd, math_param_connector_overlap_min, 0); - primitive_luatex("Umathordordspacing", set_math_param_cmd, + primitive_umath("Umathordordspacing", set_math_param_cmd, math_param_ord_ord_spacing, 0); - primitive_luatex("Umathordopspacing", set_math_param_cmd, + primitive_umath("Umathordopspacing", set_math_param_cmd, math_param_ord_op_spacing, 0); - primitive_luatex("Umathordbinspacing", set_math_param_cmd, + primitive_umath("Umathordbinspacing", set_math_param_cmd, math_param_ord_bin_spacing, 0); - primitive_luatex("Umathordrelspacing", set_math_param_cmd, + primitive_umath("Umathordrelspacing", set_math_param_cmd, math_param_ord_rel_spacing, 0); - primitive_luatex("Umathordopenspacing", set_math_param_cmd, + primitive_umath("Umathordopenspacing", set_math_param_cmd, math_param_ord_open_spacing, 0); - primitive_luatex("Umathordclosespacing", set_math_param_cmd, + primitive_umath("Umathordclosespacing", set_math_param_cmd, math_param_ord_close_spacing, 0); - primitive_luatex("Umathordpunctspacing", set_math_param_cmd, + primitive_umath("Umathordpunctspacing", set_math_param_cmd, math_param_ord_punct_spacing, 0); - primitive_luatex("Umathordinnerspacing", set_math_param_cmd, + primitive_umath("Umathordinnerspacing", set_math_param_cmd, math_param_ord_inner_spacing, 0); - primitive_luatex("Umathopordspacing", set_math_param_cmd, + primitive_umath("Umathopordspacing", set_math_param_cmd, math_param_op_ord_spacing, 0); - primitive_luatex("Umathopopspacing", set_math_param_cmd, + primitive_umath("Umathopopspacing", set_math_param_cmd, math_param_op_op_spacing, 0); - primitive_luatex("Umathopbinspacing", set_math_param_cmd, + primitive_umath("Umathopbinspacing", set_math_param_cmd, math_param_op_bin_spacing, 0); - primitive_luatex("Umathoprelspacing", set_math_param_cmd, + primitive_umath("Umathoprelspacing", set_math_param_cmd, math_param_op_rel_spacing, 0); - primitive_luatex("Umathopopenspacing", set_math_param_cmd, + primitive_umath("Umathopopenspacing", set_math_param_cmd, math_param_op_open_spacing, 0); - primitive_luatex("Umathopclosespacing", set_math_param_cmd, + primitive_umath("Umathopclosespacing", set_math_param_cmd, math_param_op_close_spacing, 0); - primitive_luatex("Umathoppunctspacing", set_math_param_cmd, + primitive_umath("Umathoppunctspacing", set_math_param_cmd, math_param_op_punct_spacing, 0); - primitive_luatex("Umathopinnerspacing", set_math_param_cmd, + primitive_umath("Umathopinnerspacing", set_math_param_cmd, math_param_op_inner_spacing, 0); - primitive_luatex("Umathbinordspacing", set_math_param_cmd, + primitive_umath("Umathbinordspacing", set_math_param_cmd, math_param_bin_ord_spacing, 0); - primitive_luatex("Umathbinopspacing", set_math_param_cmd, + primitive_umath("Umathbinopspacing", set_math_param_cmd, math_param_bin_op_spacing, 0); - primitive_luatex("Umathbinbinspacing", set_math_param_cmd, + primitive_umath("Umathbinbinspacing", set_math_param_cmd, math_param_bin_bin_spacing, 0); - primitive_luatex("Umathbinrelspacing", set_math_param_cmd, + primitive_umath("Umathbinrelspacing", set_math_param_cmd, math_param_bin_rel_spacing, 0); - primitive_luatex("Umathbinopenspacing", set_math_param_cmd, + primitive_umath("Umathbinopenspacing", set_math_param_cmd, math_param_bin_open_spacing, 0); - primitive_luatex("Umathbinclosespacing", set_math_param_cmd, + primitive_umath("Umathbinclosespacing", set_math_param_cmd, math_param_bin_close_spacing, 0); - primitive_luatex("Umathbinpunctspacing", set_math_param_cmd, + primitive_umath("Umathbinpunctspacing", set_math_param_cmd, math_param_bin_punct_spacing, 0); - primitive_luatex("Umathbininnerspacing", set_math_param_cmd, + primitive_umath("Umathbininnerspacing", set_math_param_cmd, math_param_bin_inner_spacing, 0); - primitive_luatex("Umathrelordspacing", set_math_param_cmd, + primitive_umath("Umathrelordspacing", set_math_param_cmd, math_param_rel_ord_spacing, 0); - primitive_luatex("Umathrelopspacing", set_math_param_cmd, + primitive_umath("Umathrelopspacing", set_math_param_cmd, math_param_rel_op_spacing, 0); - primitive_luatex("Umathrelbinspacing", set_math_param_cmd, + primitive_umath("Umathrelbinspacing", set_math_param_cmd, math_param_rel_bin_spacing, 0); - primitive_luatex("Umathrelrelspacing", set_math_param_cmd, + primitive_umath("Umathrelrelspacing", set_math_param_cmd, math_param_rel_rel_spacing, 0); - primitive_luatex("Umathrelopenspacing", set_math_param_cmd, + primitive_umath("Umathrelopenspacing", set_math_param_cmd, math_param_rel_open_spacing, 0); - primitive_luatex("Umathrelclosespacing", set_math_param_cmd, + primitive_umath("Umathrelclosespacing", set_math_param_cmd, math_param_rel_close_spacing, 0); - primitive_luatex("Umathrelpunctspacing", set_math_param_cmd, + primitive_umath("Umathrelpunctspacing", set_math_param_cmd, math_param_rel_punct_spacing, 0); - primitive_luatex("Umathrelinnerspacing", set_math_param_cmd, + primitive_umath("Umathrelinnerspacing", set_math_param_cmd, math_param_rel_inner_spacing, 0); - primitive_luatex("Umathopenordspacing", set_math_param_cmd, + primitive_umath("Umathopenordspacing", set_math_param_cmd, math_param_open_ord_spacing, 0); - primitive_luatex("Umathopenopspacing", set_math_param_cmd, + primitive_umath("Umathopenopspacing", set_math_param_cmd, math_param_open_op_spacing, 0); - primitive_luatex("Umathopenbinspacing", set_math_param_cmd, + primitive_umath("Umathopenbinspacing", set_math_param_cmd, math_param_open_bin_spacing, 0); - primitive_luatex("Umathopenrelspacing", set_math_param_cmd, + primitive_umath("Umathopenrelspacing", set_math_param_cmd, math_param_open_rel_spacing, 0); - primitive_luatex("Umathopenopenspacing", set_math_param_cmd, + primitive_umath("Umathopenopenspacing", set_math_param_cmd, math_param_open_open_spacing, 0); - primitive_luatex("Umathopenclosespacing", set_math_param_cmd, + primitive_umath("Umathopenclosespacing", set_math_param_cmd, math_param_open_close_spacing, 0); - primitive_luatex("Umathopenpunctspacing", set_math_param_cmd, + primitive_umath("Umathopenpunctspacing", set_math_param_cmd, math_param_open_punct_spacing, 0); - primitive_luatex("Umathopeninnerspacing", set_math_param_cmd, + primitive_umath("Umathopeninnerspacing", set_math_param_cmd, math_param_open_inner_spacing, 0); - primitive_luatex("Umathcloseordspacing", set_math_param_cmd, + primitive_umath("Umathcloseordspacing", set_math_param_cmd, math_param_close_ord_spacing, 0); - primitive_luatex("Umathcloseopspacing", set_math_param_cmd, + primitive_umath("Umathcloseopspacing", set_math_param_cmd, math_param_close_op_spacing, 0); - primitive_luatex("Umathclosebinspacing", set_math_param_cmd, + primitive_umath("Umathclosebinspacing", set_math_param_cmd, math_param_close_bin_spacing, 0); - primitive_luatex("Umathcloserelspacing", set_math_param_cmd, + primitive_umath("Umathcloserelspacing", set_math_param_cmd, math_param_close_rel_spacing, 0); - primitive_luatex("Umathcloseopenspacing", set_math_param_cmd, + primitive_umath("Umathcloseopenspacing", set_math_param_cmd, math_param_close_open_spacing, 0); - primitive_luatex("Umathcloseclosespacing", set_math_param_cmd, + primitive_umath("Umathcloseclosespacing", set_math_param_cmd, math_param_close_close_spacing, 0); - primitive_luatex("Umathclosepunctspacing", set_math_param_cmd, + primitive_umath("Umathclosepunctspacing", set_math_param_cmd, math_param_close_punct_spacing, 0); - primitive_luatex("Umathcloseinnerspacing", set_math_param_cmd, + primitive_umath("Umathcloseinnerspacing", set_math_param_cmd, math_param_close_inner_spacing, 0); - primitive_luatex("Umathpunctordspacing", set_math_param_cmd, + primitive_umath("Umathpunctordspacing", set_math_param_cmd, math_param_punct_ord_spacing, 0); - primitive_luatex("Umathpunctopspacing", set_math_param_cmd, + primitive_umath("Umathpunctopspacing", set_math_param_cmd, math_param_punct_op_spacing, 0); - primitive_luatex("Umathpunctbinspacing", set_math_param_cmd, + primitive_umath("Umathpunctbinspacing", set_math_param_cmd, math_param_punct_bin_spacing, 0); - primitive_luatex("Umathpunctrelspacing", set_math_param_cmd, + primitive_umath("Umathpunctrelspacing", set_math_param_cmd, math_param_punct_rel_spacing, 0); - primitive_luatex("Umathpunctopenspacing", set_math_param_cmd, + primitive_umath("Umathpunctopenspacing", set_math_param_cmd, math_param_punct_open_spacing, 0); - primitive_luatex("Umathpunctclosespacing", set_math_param_cmd, + primitive_umath("Umathpunctclosespacing", set_math_param_cmd, math_param_punct_close_spacing, 0); - primitive_luatex("Umathpunctpunctspacing", set_math_param_cmd, + primitive_umath("Umathpunctpunctspacing", set_math_param_cmd, math_param_punct_punct_spacing, 0); - primitive_luatex("Umathpunctinnerspacing", set_math_param_cmd, + primitive_umath("Umathpunctinnerspacing", set_math_param_cmd, math_param_punct_inner_spacing, 0); - primitive_luatex("Umathinnerordspacing", set_math_param_cmd, + primitive_umath("Umathinnerordspacing", set_math_param_cmd, math_param_inner_ord_spacing, 0); - primitive_luatex("Umathinneropspacing", set_math_param_cmd, + primitive_umath("Umathinneropspacing", set_math_param_cmd, math_param_inner_op_spacing, 0); - primitive_luatex("Umathinnerbinspacing", set_math_param_cmd, + primitive_umath("Umathinnerbinspacing", set_math_param_cmd, math_param_inner_bin_spacing, 0); - primitive_luatex("Umathinnerrelspacing", set_math_param_cmd, + primitive_umath("Umathinnerrelspacing", set_math_param_cmd, math_param_inner_rel_spacing, 0); - primitive_luatex("Umathinneropenspacing", set_math_param_cmd, + primitive_umath("Umathinneropenspacing", set_math_param_cmd, math_param_inner_open_spacing, 0); - primitive_luatex("Umathinnerclosespacing", set_math_param_cmd, + primitive_umath("Umathinnerclosespacing", set_math_param_cmd, math_param_inner_close_spacing, 0); - primitive_luatex("Umathinnerpunctspacing", set_math_param_cmd, + primitive_umath("Umathinnerpunctspacing", set_math_param_cmd, math_param_inner_punct_spacing, 0); - primitive_luatex("Umathinnerinnerspacing", set_math_param_cmd, + primitive_umath("Umathinnerinnerspacing", set_math_param_cmd, math_param_inner_inner_spacing, 0); @ These are in a separate module due to a CWEAVE limitation. @<Create another bunch of primitives@>= - primitive_omega("omathcode", extdef_math_code_cmd, math_code_base, - math_code_base); - primitive_omega("odelcode", extdef_del_code_cmd, del_code_base, - del_code_base); - primitive_luatex("Umathcode", extdef_math_code_cmd, math_code_base + 1, + primitive_umath("Umathcode", extdef_math_code_cmd, math_code_base, math_code_base); - primitive_luatex("Udelcode", extdef_del_code_cmd, del_code_base + 1, + primitive_umath("Udelcode", extdef_del_code_cmd, del_code_base, del_code_base); - primitive_luatex("Umathcodenum", extdef_math_code_cmd, math_code_base + 2, + primitive_umath("Umathcodenum", extdef_math_code_cmd, math_code_base + 1, math_code_base); - primitive_luatex("Udelcodenum", extdef_del_code_cmd, del_code_base + 2, + primitive_umath("Udelcodenum", extdef_del_code_cmd, del_code_base + 1, del_code_base); primitive_tex("hyphenation", hyph_data_cmd, 0, 0); primitive_tex("patterns", hyph_data_cmd, 1, 0); @@ -1040,17 +1029,9 @@ void initialize_commands(void) void initialize_etex_commands(void) { primitive_etex("lastnodetype", last_item_cmd, last_node_type_code, 0); - primitive_aleph("Alephversion", last_item_cmd, Aleph_version_code, 0); - primitive_aleph("Omegaversion", last_item_cmd, Omega_version_code, 0); primitive_etex("eTeXversion", last_item_cmd, eTeX_version_code, 0); - primitive_aleph("Alephminorversion", last_item_cmd, - Aleph_minor_version_code, 0); - primitive_aleph("Omegaminorversion", last_item_cmd, - Omega_minor_version_code, 0); primitive_etex("eTeXminorversion", last_item_cmd, eTeX_minor_version_code, 0); - primitive_aleph("Alephrevision", convert_cmd, Aleph_revision_code, 0); - primitive_aleph("Omegarevision", convert_cmd, Omega_revision_code, 0); primitive_etex("eTeXrevision", convert_cmd, eTeX_revision_code, 0); /* First we implement the additional \eTeX\ parameters in the table of equivalents. */ diff --git a/Build/source/texk/web2c/luatexdir/tex/conditional.w b/Build/source/texk/web2c/luatexdir/tex/conditional.w index a4a327568ab..b1821bff530 100644 --- a/Build/source/texk/web2c/luatexdir/tex/conditional.w +++ b/Build/source/texk/web2c/luatexdir/tex/conditional.w @@ -1,28 +1,28 @@ % conditional.w -% +% % Copyright 2009-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -#include "ptexlib.h" - static const char _svn_version[] = - "$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 $"; + "$Id: conditional.w 4442 2012-05-25 22:40:34Z hhenkel $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/conditional.w $"; + +#include "ptexlib.h" @ @c #define box(A) eqtb[box_base+(A)].hh.rh diff --git a/Build/source/texk/web2c/luatexdir/tex/directions.h b/Build/source/texk/web2c/luatexdir/tex/directions.h index f7b3e784d07..30f52743388 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 3853 2010-09-03 18:05:14Z oneiros $ */ +/* $Id: directions.h 4569 2013-01-30 10:08:33Z taco $ */ #ifndef DIRECTIONS_H # define DIRECTIONS_H @@ -32,6 +32,7 @@ # define dir_LTL 9 # define dir_RTT 24 +extern const char *dir_strings[128]; /* # define dir_array_size 25 *//* |dir_RTT + 1| */ @@ -305,22 +306,22 @@ _textdir_is[dir_RTT] = 0; # define textdir_is_L(a) (a == dir_TLT) -# define push_dir(a) \ +# define push_dir(a,b) \ { halfword dir_tmp=new_dir((a)); \ - vlink(dir_tmp)=dir_ptr; \ - dir_ptr=dir_tmp; \ + vlink(dir_tmp)=b; \ + b=dir_tmp; \ } -# define push_dir_node(a) \ - { halfword dir_tmp=copy_node((a)); \ - vlink(dir_tmp)=dir_ptr; \ - dir_ptr=dir_tmp; \ +# define push_dir_node(a,b) \ + { halfword dir_tmp=copy_node((a)); \ + vlink(dir_tmp)=b; \ + b=dir_tmp; \ } -# define pop_dir_node() \ - { halfword dir_tmp=dir_ptr; \ - dir_ptr=vlink(dir_tmp); \ - flush_node(dir_tmp); \ +# define pop_dir_node(b) \ + { halfword dir_tmp=b; \ + b=vlink(dir_tmp); \ + flush_node(dir_tmp); \ } extern halfword dir_ptr; diff --git a/Build/source/texk/web2c/luatexdir/tex/directions.w b/Build/source/texk/web2c/luatexdir/tex/directions.w index 15f03049bf4..d25ff168433 100644 --- a/Build/source/texk/web2c/luatexdir/tex/directions.w +++ b/Build/source/texk/web2c/luatexdir/tex/directions.w @@ -1,28 +1,28 @@ % directions.w - +% % Copyright 2009-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -#include "ptexlib.h" - static const char _svn_version[] = - "$Id: directions.w 3587 2010-04-03 14:32:25Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/directions.w $"; + "$Id: directions.w 4569 2013-01-30 10:08:33Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/directions.w $"; + +#include "ptexlib.h" @ @c void scan_direction(void) @@ -96,20 +96,33 @@ halfword new_dir(int s) return p; } -@ @c +@ The global static array variable |dir_strings| is also used +by the lua nodelib interface, so it cannot be static. Putting +it here instead of there avoid the nodelib having to know +about the actual values of |dir_TRT| etc. + +@c +const char *dir_strings[128] = { + "-TLT","???", "???", "???", "-TRT","???", "???", "???", + "???", "-LTL","???", "???", "???", "???", "???", "???", + "???", "???", "???", "???", "???", "???", "???", "???", + "-RTT","???", "???", "???", "???", "???", "???", "???", + "???", "???", "???", "???", "???", "???", "???", "???", + "???", "???", "???", "???", "???", "???", "???", "???", + "???", "???", "???", "???", "???", "???", "???", "???", + "???", "???", "???", "???", "???", "???", "???", "???", + "+TLT","???", "???", "???", "+TRT","???", "???", "???", + "???", "+LTL","???", "???", "???", "???", "???", "???", + "???", "???", "???", "???", "???", "???", "???", "???", + "+RTT","???", "???", "???", "???", "???", "???", "???", + "???", "???", "???", "???", "???", "???", "???", "???", + "???", "???", "???", "???", "???", "???", "???", "???", + "???", "???", "???", "???", "???", "???", "???", "???", + "???", "???", "???", "???", "???", "???", "???", "???" }; + const char *string_dir(int d) { - if (d == dir_TLT) { - return "TLT"; - } else if (d == dir_TRT) { - return "TRT"; - } else if (d == dir_LTL) { - return "LTL"; - } else if (d == dir_RTT) { - return "RTT"; - } else { - return "???"; - } + return (dir_strings[d+64]+1); } diff --git a/Build/source/texk/web2c/luatexdir/tex/dumpdata.h b/Build/source/texk/web2c/luatexdir/tex/dumpdata.h index 07a62f87ef5..349e37fb238 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 3853 2010-09-03 18:05:14Z oneiros $ */ +/* $Id: dumpdata.h 4479 2012-11-07 16:38:55Z taco $ */ #ifndef DUMPDATA_H # define DUMPDATA_H diff --git a/Build/source/texk/web2c/luatexdir/tex/dumpdata.w b/Build/source/texk/web2c/luatexdir/tex/dumpdata.w index 8a58fa94144..e9bbdbb18bb 100644 --- a/Build/source/texk/web2c/luatexdir/tex/dumpdata.w +++ b/Build/source/texk/web2c/luatexdir/tex/dumpdata.w @@ -1,28 +1,28 @@ % dumpdata.w -% +% % Copyright 2009-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along -% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. +% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -#include "ptexlib.h" - static const char _svn_version[] = - "$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 $"; + "$Id: dumpdata.w 4563 2013-01-21 03:22:53Z khaled $" + "$URL: http://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 @@ -107,7 +107,7 @@ void store_fmt_file(void) tprint(fmtname); free(fmtname); tprint_nl(""); - slow_print(format_ident); + print(format_ident); /* Dump constants for consistency check */ /* The next few sections of the program should make it clear how we use the diff --git a/Build/source/texk/web2c/luatexdir/tex/equivalents.w b/Build/source/texk/web2c/luatexdir/tex/equivalents.w index a3639112620..830dab59d6f 100644 --- a/Build/source/texk/web2c/luatexdir/tex/equivalents.w +++ b/Build/source/texk/web2c/luatexdir/tex/equivalents.w @@ -1,28 +1,28 @@ % equivalents.w -% +% % Copyright 2009-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -#include "ptexlib.h" - static const char _svn_version[] = - "$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 $"; + "$Id: equivalents.w 4442 2012-05-25 22:40:34Z hhenkel $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/equivalents.w $"; + +#include "ptexlib.h" @ @c #define par_shape_ptr equiv(par_shape_loc) diff --git a/Build/source/texk/web2c/luatexdir/tex/errors.w b/Build/source/texk/web2c/luatexdir/tex/errors.w index 3a5bb4c8647..fdc9cb12f3c 100644 --- a/Build/source/texk/web2c/luatexdir/tex/errors.w +++ b/Build/source/texk/web2c/luatexdir/tex/errors.w @@ -1,28 +1,28 @@ % errors.w -% +% % Copyright 2009-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along -% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. +% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -#include "ptexlib.h" - static const char _svn_version[] = - "$Id: errors.w 3587 2010-04-03 14:32:25Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/errors.w $"; + "$Id: errors.w 4563 2013-01-21 03:22:53Z khaled $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/errors.w $"; + +#include "ptexlib.h" @ @c #define new_line_char int_par(new_line_char_code) @@ -83,13 +83,13 @@ error messages are \hang|term_and_log| (when |interaction>batch_mode| and |log_file| is open). @c -void fixup_selector(boolean log_opened) +void fixup_selector(boolean logopened) { if (interaction == batch_mode) selector = no_print; else selector = term_only; - if (log_opened) + if (logopened) selector = selector + 2; } @@ -177,14 +177,13 @@ void error(void) ASCII_code c; /* what the user types */ int callback_id; int s1, s2, s3, s4; /* used to save global variables when deleting tokens */ - boolean t; int i; if (history < error_message_issued) history = error_message_issued; print_char('.'); callback_id = callback_defined(show_error_hook_callback); if (callback_id > 0) - t = run_callback(callback_id, "->"); + run_callback(callback_id, "->"); show_context(); if (haltonerrorp) { history = fatal_error_stop; @@ -261,7 +260,7 @@ void error(void) case 'E': if (base_ptr > 0) { tprint_nl("You want to edit file "); - slow_print(input_stack[base_ptr].name_field); + print(input_stack[base_ptr].name_field); tprint(" at line "); print_int(line); interaction = scroll_mode; @@ -370,9 +369,9 @@ void error(void) print_ln(); give_err_help(); } else { - int i = 0; - while (help_line[i] != NULL) - tprint_nl(help_line[i++]); + int i1 = 0; + while (help_line[i1] != NULL) + tprint_nl(help_line[i1++]); } print_ln(); if (interaction > batch_mode) @@ -402,7 +401,7 @@ running a bit longer. @c void normalize_selector(void) { - if (log_opened) + if (log_opened_global) selector = term_and_log; else selector = term_only; @@ -418,7 +417,7 @@ void succumb(void) { if (interaction == error_stop_mode) interaction = scroll_mode; /* no more interaction */ - if (log_opened) + if (log_opened_global) error(); #ifdef DEBUG if (interaction > batch_mode) diff --git a/Build/source/texk/web2c/luatexdir/tex/expand.w b/Build/source/texk/web2c/luatexdir/tex/expand.w index 1a203d0c0e2..9e3c2f2fab8 100644 --- a/Build/source/texk/web2c/luatexdir/tex/expand.w +++ b/Build/source/texk/web2c/luatexdir/tex/expand.w @@ -1,29 +1,28 @@ % expand.w -% +% % Copyright 2009-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -#include "ptexlib.h" - static const char _svn_version[] = - "$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 $"; + "$Id: expand.w 4442 2012-05-25 22:40:34Z hhenkel $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/expand.w $"; +#include "ptexlib.h" @ Only a dozen or so command codes |>max_command| can possibly be returned by |get_next|; in increasing order, they are |undefined_cs|, |expand_after|, diff --git a/Build/source/texk/web2c/luatexdir/tex/extensions.w b/Build/source/texk/web2c/luatexdir/tex/extensions.w index 38e91d0a94e..0d03c3e9caf 100644 --- a/Build/source/texk/web2c/luatexdir/tex/extensions.w +++ b/Build/source/texk/web2c/luatexdir/tex/extensions.w @@ -1,19 +1,19 @@ % extensions.w - +% % Copyright 2009-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @@ -22,8 +22,8 @@ @ @c static const char _svn_version[] = - "$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 $"; + "$Id: extensions.w 4519 2012-12-14 09:11:19Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/extensions.w $"; #include "ptexlib.h" @@ -454,9 +454,9 @@ void do_extension(PDF pdf) case save_cat_code_table_code: /* Implement \.{\\savecatcodetable} */ scan_int(); - if ((cur_val < 0) || (cur_val > 0xFFFF)) { + if ((cur_val < 0) || (cur_val > 0x7FFF)) { print_err("Invalid \\catcode table"); - help1("All \\catcode table ids must be between 0 and 0xFFFF"); + help1("All \\catcode table ids must be between 0 and 0x7FFF"); error(); } else { if (cur_val == cat_code_table) { @@ -471,9 +471,9 @@ void do_extension(PDF pdf) case init_cat_code_table_code: /* Implement \.{\\initcatcodetable} */ scan_int(); - if ((cur_val < 0) || (cur_val > 0xFFFF)) { + if ((cur_val < 0) || (cur_val > 0x7FFF)) { print_err("Invalid \\catcode table"); - help1("All \\catcode table ids must be between 0 and 0xFFFF"); + help1("All \\catcode table ids must be between 0 and 0x7FFF"); error(); } else { if (cur_val == cat_code_table) { diff --git a/Build/source/texk/web2c/luatexdir/tex/filename.w b/Build/source/texk/web2c/luatexdir/tex/filename.w index 77776a50087..f550aad5643 100644 --- a/Build/source/texk/web2c/luatexdir/tex/filename.w +++ b/Build/source/texk/web2c/luatexdir/tex/filename.w @@ -1,28 +1,28 @@ % filename.w - +% % Copyright 2009-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along -% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. +% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -#include "ptexlib.h" - static const char _svn_version[] = - "$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 $"; + "$Id: filename.w 4442 2012-05-25 22:40:34Z hhenkel $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/filename.w $"; + +#include "ptexlib.h" @ In order to isolate the system-dependent aspects of file names, the @@ -80,7 +80,7 @@ static boolean more_name(ASCII_code c) } else { str_room(1); append_char(c); /* contribute |c| to the current string */ - if (ISDIRSEP(c)) { + if (IS_DIR_SEP(c)) { area_delimiter = (pool_pointer) cur_length; ext_delimiter = 0; } else if (c == '.') @@ -187,7 +187,7 @@ void scan_file_name_toks(void) a = n = s; e = NULL; for (i = 0; i < l; i++) { - if (ISDIRSEP(s[i])) { + if (IS_DIR_SEP(s[i])) { n = s + i + 1; e = NULL; } else if (s[i] == '.') { diff --git a/Build/source/texk/web2c/luatexdir/tex/inputstack.w b/Build/source/texk/web2c/luatexdir/tex/inputstack.w index f52ca45c4fb..fe310582c91 100644 --- a/Build/source/texk/web2c/luatexdir/tex/inputstack.w +++ b/Build/source/texk/web2c/luatexdir/tex/inputstack.w @@ -1,28 +1,28 @@ % inputstack.w - +% % Copyright 2009-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along -% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. +% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -#include "ptexlib.h" - static const char _svn_version[] = - "$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 $"; + "$Id: inputstack.w 4442 2012-05-25 22:40:34Z hhenkel $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/inputstack.w $"; + +#include "ptexlib.h" @ @c #define end_line_char int_par(end_line_char_code) @@ -391,7 +391,7 @@ void push_input(void) incr(input_ptr); } -@ +@ Here is a procedure that starts a new level of token-list input, given a token list |p| and its type |t|. If |t=macro|, the calling routine should set |name| and |loc|. @@ -491,7 +491,7 @@ void back_input(void) iloc = p; /* that was |back_list(p)|, without procedure overhead */ } -@ Insert token |p| into \TeX's input +@ Insert token |p| into \TeX's input @c int reinsert_token(boolean a, halfword pp) { @@ -586,7 +586,7 @@ void clear_for_error_prompt(void) } @ To get \TeX's whole input mechanism going, we perform the following - actions. + actions. @c void initialize_inputstack(void) @@ -686,7 +686,7 @@ static halfword string_to_pseudo(str_number str, int nl) } -@ The |pseudo_start| procedure initiates reading from a pseudo file. +@ The |pseudo_start| procedure initiates reading from a pseudo file. @c void pseudo_from_string(void) @@ -780,7 +780,7 @@ boolean pseudo_input(void) return true; } -@ When we are done with a pseudo file we `close' it +@ When we are done with a pseudo file we `close' it. @c void pseudo_close(void) diff --git a/Build/source/texk/web2c/luatexdir/tex/linebreak.w b/Build/source/texk/web2c/luatexdir/tex/linebreak.w index 1478839f8d6..57cf6834c59 100644 --- a/Build/source/texk/web2c/luatexdir/tex/linebreak.w +++ b/Build/source/texk/web2c/luatexdir/tex/linebreak.w @@ -1,28 +1,28 @@ % linebreak.w -% +% % Copyright 2006-2008 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along -% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. +% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -#include "ptexlib.h" - static const char _svn_version[] = - "$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 $"; + "$Id: linebreak.w 4457 2012-07-13 13:16:19Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/linebreak.w $"; + +#include "ptexlib.h" @ We come now to what is probably the most interesting algorithm of \TeX: the mechanism for choosing the ``best possible'' breakpoints that yield @@ -105,13 +105,6 @@ void line_break(boolean d, int line_break_context) pack_begin_line = cur_list.ml_field; /* this is for over/underfull box messages */ vlink(temp_head) = vlink(cur_list.head_field); new_hyphenation(temp_head, cur_list.tail_field); - if ((!is_char_node(vlink(cur_list.head_field))) - && ((type(vlink(cur_list.head_field)) == whatsit_node) - && (subtype(vlink(cur_list.head_field)) == local_par_node))) - paragraph_dir = local_par_dir(vlink(cur_list.head_field)); - else { - assert(0); /* |paragraph_dir = 0|; */ - } cur_list.tail_field = new_ligkern(temp_head, cur_list.tail_field); if (is_char_node(cur_list.tail_field)) { tail_append(new_penalty(inf_penalty)); @@ -127,12 +120,34 @@ void line_break(boolean d, int line_break_context) final_par_glue = new_param_glue(par_fill_skip_code); couple_nodes(cur_list.tail_field, final_par_glue); cur_list.tail_field = vlink(cur_list.tail_field); +#ifdef DEBUG + { + int n = temp_head; + fprintf(stdout, "pre_linebreak_filter status:\n"); + while (n) { + fprintf(stdout, " %s node %d\n", + get_node_name(type(n), subtype(n)), (int) n); + n = vlink(n); + } + } +#endif lua_node_filter(pre_linebreak_filter_callback, line_break_context, temp_head, addressof(cur_list.tail_field)); last_line_fill = cur_list.tail_field; pop_nest(); start_of_par = cur_list.tail_field; +#ifdef DEBUG + { + int n = temp_head; + fprintf(stdout, "pre_linebreak_filter returned:\n"); + while (n) { + fprintf(stdout, " %s node %d\n", + get_node_name(type(n), subtype(n)), (int) n); + n = vlink(n); + } + } +#endif callback_id = callback_defined(linebreak_filter_callback); if (callback_id > 0) { callback_id = @@ -169,6 +184,12 @@ void line_break(boolean d, int line_break_context) } } if (callback_id == 0) { + if ((!is_char_node(vlink(temp_head))) + && ((type(vlink(temp_head)) == whatsit_node) + && (subtype(vlink(temp_head)) == local_par_node))) + paragraph_dir = local_par_dir(vlink(temp_head)); + else + assert(0); /* |paragraph_dir = 0|; */ ext_do_line_break(paragraph_dir, int_par(pretolerance_code), int_par(tracing_paragraphs_code), @@ -1272,8 +1293,8 @@ ext_try_break(int pi, shortfall -= passive_last_left_box_width(break_node(r)); shortfall -= internal_right_box_width; if (pdf_protrude_chars > 1) { - halfword l, o; - l = (break_node(r) == null) ? first_p : cur_break(break_node(r)); + halfword l1, o; + l1 = (break_node(r) == null) ? first_p : cur_break(break_node(r)); if (cur_p == null) { o = null; } else { /* TODO |if (is_character_node(alink(cur_p)))| */ @@ -1295,17 +1316,17 @@ ext_try_break(int pi, /* a |disc_node| with non-empty |pre_break|, protrude the last char of |pre_break| */ o = tlink_pre_break(cur_p); } else { - o = find_protchar_right(l, o); + o = find_protchar_right(l1, o); } /* now the left margin */ - if ((l != null) && (type(l) == disc_node) - && (vlink_post_break(l) != null)) { + if ((l1 != null) && (type(l1) == disc_node) + && (vlink_post_break(l1) != null)) { /* FIXME: first 'char' could be a disc! */ - l = vlink_post_break(l); /* protrude the first char */ + l1 = vlink_post_break(l1); /* protrude the first char */ } else { - l = find_protchar_left(l, true); + l1 = find_protchar_left(l1, true); } - shortfall += (left_pw(l) + right_pw(o)); + shortfall += (left_pw(l1) + right_pw(o)); } if ((shortfall != 0) && (pdf_adjust_spacing > 1)) { margin_kern_stretch = 0; @@ -1740,7 +1761,7 @@ ext_do_line_break(int paragraph_dir, dir_ptr = null; } #if 0 - push_dir(paragraph_dir); /* TODO what was the point of this? */ + push_dir(paragraph_dir,dir_ptr); /* TODO what was the point of this? */ #endif /* Find optimal breakpoints; */ @@ -1867,9 +1888,9 @@ ext_do_line_break(int paragraph_dir, case dir_node: /* DIR: Adjust the dir stack for the |line_break| routine; */ if (dir_dir(cur_p) >= 0) { line_break_dir = dir_dir(cur_p); - push_dir_node(cur_p); /* adds to |dir_ptr| */ + push_dir_node(cur_p,dir_ptr); /* adds to |dir_ptr| */ } else { - pop_dir_node(); + pop_dir_node(dir_ptr); if (dir_ptr != null) line_break_dir = dir_dir(dir_ptr); } diff --git a/Build/source/texk/web2c/luatexdir/tex/mainbody.h b/Build/source/texk/web2c/luatexdir/tex/mainbody.h index 98434521776..789ef80ad99 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 3911 2010-10-16 07:28:11Z taco $ */ +/* $Id: mainbody.h 4462 2012-08-07 15:08:21Z taco $ */ #ifndef MAINBODY_H # define MAINBODY_H @@ -57,7 +57,7 @@ in production versions of \TeX. # define sup_param_size 32767 # define inf_save_size 600 -# define sup_save_size 80000 +# define sup_save_size 250000 # define inf_stack_size 200 # define sup_stack_size 30000 @@ -96,7 +96,6 @@ typedef unsigned char glue_ord; /* infinity to the 0, 1, 2, 3, or 4 power */ typedef unsigned short group_code; /* |save_level| for a level boundary */ -typedef int internal_font_number; /* |font| in a |char_node| */ typedef int font_index; /* index into |font_info| */ typedef int save_pointer; @@ -116,7 +115,6 @@ names in this program because they are used with a special meaning. # define carriage_return '\r' /* ASCII code used at end of line */ /* Global variables */ -extern int bad; /* is some ``constant'' wrong? */ extern boolean luainit; /* are we using lua for initializations */ extern boolean tracefilenames; /* print file open-close info? */ diff --git a/Build/source/texk/web2c/luatexdir/tex/mainbody.w b/Build/source/texk/web2c/luatexdir/tex/mainbody.w index 93ea9018d13..2c6ae2b6dd6 100644 --- a/Build/source/texk/web2c/luatexdir/tex/mainbody.w +++ b/Build/source/texk/web2c/luatexdir/tex/mainbody.w @@ -1,19 +1,19 @@ % mainbody.w - +% % Copyright 2009-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @@ -22,11 +22,11 @@ \def\pdfTeX{pdf\TeX} @ @c -#include "ptexlib.h" - static const char _svn_version[] = - "$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 $"; + "$Id: mainbody.w 4563 2013-01-21 03:22:53Z khaled $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/mainbody.w $"; + +#include "ptexlib.h" @ pdfTeX is copyright (C) 1996-2006 Han The Thanh, <thanh@@pdftex.org>. @@ -178,14 +178,10 @@ A similar test suite called the ``\.{e-TRIP} test'' is available for helping to determine whether a particular implementation deserves to be known as `\eTeX'. -@ In case somebody has inadvertently made bad settings of the ``constants,'' -\TeX\ checks them using a global variable called |bad|. - -This is the first of many sections of \TeX\ where global variables are +@ This is the first of many sections of \TeX\ where global variables are defined. @c -int bad; /* is some ``constant'' wrong? */ boolean luainit; /* are we using lua for initializations */ boolean tracefilenames; /* print file open-close info? */ @@ -280,6 +276,8 @@ int ready_already = 0; int main_initialize(void) { + /* In case somebody has inadvertently made bad settings of the ``constants,'' + \LuaTeX\ checks them using a variable called |bad|. */ int bad = 0; /* Bounds that may be set from the configuration file. We want the user to be able to specify the names with underscores, but \.{TANGLE} removes @@ -405,7 +403,7 @@ int main_initialize(void) void main_body(void) { static char pdftex_map[] = "pdftex.map"; - bad = main_initialize(); + int bad = main_initialize(); history = fatal_error_stop; /* in case we quit during initialization */ t_open_out(); /* open the terminal for output */ if (!luainit) @@ -455,7 +453,7 @@ void main_body(void) random_seed = (microseconds * 1000) + (epochseconds % 1000000); init_randoms(random_seed); initialize_math(); - fixup_selector(log_opened); + fixup_selector(log_opened_global); check_texconfig_init(); if ((iloc < ilimit) && (get_cat_code(int_par(cat_code_table_code), buffer[iloc]) != escape_cmd)) @@ -508,7 +506,7 @@ void close_files_and_terminate(void) up |string_pool| memory when a non-{\bf stat} version of \TeX\ is being used. */ - if (log_opened) { + if (log_opened_global) { fprintf(log_file, "\n\nHere is how much of LuaTeX's memory you used:\n"); fprintf(log_file, " %d string%s out of %d\n", @@ -557,11 +555,11 @@ void close_files_and_terminate(void) assert(0); } /* Close {\sl Sync\TeX} file and write status */ - synctexterminate(log_opened); /* Let the {\sl Sync\TeX} controller close its files. */ + synctexterminate(log_opened_global); /* Let the {\sl Sync\TeX} controller close its files. */ free_text_codes(); free_math_codes(); - if (log_opened) { + if (log_opened_global) { wlog_cr(); selector = selector - 2; if ((selector == term_only) && (callback_id == 0)) { @@ -713,7 +711,7 @@ void debug_help(void) show_token_list(n, null, 1000); break; case 10: - slow_print(n); + print(n); break; case 13: (void) fscanf(term_in, "%d", &l); diff --git a/Build/source/texk/web2c/luatexdir/tex/maincontrol.h b/Build/source/texk/web2c/luatexdir/tex/maincontrol.h index 6a4915faddc..681a69c96e3 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 3752 2010-07-27 10:18:24Z taco $ */ +/* $Id: maincontrol.h 4562 2013-01-21 02:58:59Z khaled $ */ #ifndef MAINCONTROL_H # define MAINCONTROL_H @@ -104,15 +104,14 @@ corresponding |chr| is the |eqtb| location of the internal register in question. # define char_def_code 0 /* |shorthand_def| for \.{\\chardef} */ # define math_char_def_code 1 /* |shorthand_def| for \.{\\mathchardef} */ -# define omath_char_def_code 2 /* |shorthand_def| for \.{\\omathchardef} */ -# define xmath_char_def_code 3 /* |shorthand_def| for \.{\\Umathchardef} */ -# define count_def_code 4 /* |shorthand_def| for \.{\\countdef} */ -# define attribute_def_code 5 /* |shorthand_def| for \.{\\attributedef} */ -# define dimen_def_code 6 /* |shorthand_def| for \.{\\dimendef} */ -# define skip_def_code 7 /* |shorthand_def| for \.{\\skipdef} */ -# define mu_skip_def_code 8 /* |shorthand_def| for \.{\\muskipdef} */ -# define toks_def_code 9 /* |shorthand_def| for \.{\\toksdef} */ -# define umath_char_def_code 10 /* |shorthand_def| for \.{\\Umathcharnumdef} */ +# define xmath_char_def_code 2 /* |shorthand_def| for \.{\\Umathchardef} */ +# define count_def_code 3 /* |shorthand_def| for \.{\\countdef} */ +# define attribute_def_code 4 /* |shorthand_def| for \.{\\attributedef} */ +# define dimen_def_code 5 /* |shorthand_def| for \.{\\dimendef} */ +# define skip_def_code 6 /* |shorthand_def| for \.{\\skipdef} */ +# define mu_skip_def_code 7 /* |shorthand_def| for \.{\\muskipdef} */ +# define toks_def_code 8 /* |shorthand_def| for \.{\\toksdef} */ +# define umath_char_def_code 9 /* |shorthand_def| for \.{\\Umathcharnumdef} */ extern void adjust_space_factor(void); extern void main_control(void); diff --git a/Build/source/texk/web2c/luatexdir/tex/maincontrol.w b/Build/source/texk/web2c/luatexdir/tex/maincontrol.w index c8c3d802a09..54fcf56d98f 100644 --- a/Build/source/texk/web2c/luatexdir/tex/maincontrol.w +++ b/Build/source/texk/web2c/luatexdir/tex/maincontrol.w @@ -1,26 +1,26 @@ % maincontrol.w - +% % Copyright 2009-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c static const char _svn_version[] = - "$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 $"; + "$Id: maincontrol.w 4562 2013-01-21 02:58:59Z khaled $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/maincontrol.w $"; #include "ptexlib.h" @@ -330,8 +330,6 @@ static void run_math_char_num (void) { 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); @@ -345,12 +343,6 @@ static void run_math_given (void) { 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); @@ -556,8 +548,6 @@ static void run_math_char_num_mmode (void) { 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); @@ -571,12 +561,6 @@ static void run_math_given_mmode (void) { 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); @@ -588,8 +572,6 @@ 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); @@ -689,11 +671,9 @@ static void init_main_control (void) { 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; @@ -807,7 +787,6 @@ static void init_main_control (void) { 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; @@ -2255,13 +2234,6 @@ void prefixed_command(void) mval.character_value; define(p, math_given_cmd, cur_val); break; - case omath_char_def_code: - mval = scan_mathchar(aleph_mathcode); - cur_val = - (mval.class_value * 256 + mval.family_value) * 65536 + - mval.character_value; - define(p, omath_given_cmd, cur_val); - break; case xmath_char_def_code: mval = scan_mathchar(xetex_mathcode); cur_val = @@ -2410,10 +2382,19 @@ void prefixed_command(void) eq_word_define(int_base + math_direction_code, cur_val); break; case int_base + text_direction_code: +#if 0 + /* various tests hint that this is unnecessary and + * sometimes even produces weird results, eg + * (\hbox{\textdir TRT ABC\textdir TLT DEF}) + * becomes + * (DEFCBA) + * in the output + */ if ((no_local_dirs > 0) && (abs(mode) == hmode)) { /* DIR: Add local dir node */ tail_append(new_dir(text_direction)); } +#endif update_text_dir_ptr(cur_val); if (abs(mode) == hmode) { /* DIR: Add local dir node */ @@ -2503,16 +2484,12 @@ void prefixed_command(void) else cur_val1 = cur_level; if (cur_chr == math_code_base) - scan_extdef_math_code(cur_val1, aleph_mathcode); - else if (cur_chr == math_code_base + 1) scan_extdef_math_code(cur_val1, xetex_mathcode); - else if (cur_chr == math_code_base + 2) + else if (cur_chr == math_code_base + 1) scan_extdef_math_code(cur_val1, xetexnum_mathcode); else if (cur_chr == del_code_base) - scan_extdef_del_code(cur_val1, aleph_mathcode); - else if (cur_chr == del_code_base + 1) scan_extdef_del_code(cur_val1, xetex_mathcode); - else if (cur_chr == del_code_base + 2) + else if (cur_chr == del_code_base + 1) scan_extdef_del_code(cur_val1, xetexnum_mathcode); break; case def_family_cmd: @@ -2789,15 +2766,15 @@ void get_r_token(void) } @ @c -void assign_internal_value(int a, halfword p, int cur_val) +void assign_internal_value(int a, halfword p, int val) { halfword n; if ((p >= int_base) && (p < attribute_base)) { switch ((p - int_base)) { case cat_code_table_code: - if (valid_catcode_table(cur_val)) { - if (cur_val != int_par(cat_code_table_code)) - word_define(p, cur_val); + if (valid_catcode_table(val)) { + if (val != int_par(cat_code_table_code)) + word_define(p, val); } else { print_err("Invalid \\catcode table"); help2 @@ -2807,55 +2784,66 @@ void assign_internal_value(int a, halfword p, int cur_val) } break; case output_box_code: - if ((cur_val > 65535) | (cur_val < 0)) { + if ((val > 65535) | (val < 0)) { print_err("Invalid \\outputbox"); help1 ("The value for \\outputbox has to be between 0 and 65535."); error(); } else { - word_define(p, cur_val); + word_define(p, val); } break; case new_line_char_code: - if (cur_val > 127) { + if (val > 127) { print_err("Invalid \\newlinechar"); help2 ("The value for \\newlinechar has to be between 0 and 127.", "Your invalid assignment will be ignored."); error(); - } else if (cur_val < 0) { + } else if (val < 0) { word_define(p, -1); } else { - word_define(p, cur_val); + word_define(p, val); } break; case end_line_char_code: - if (cur_val < 0) { + if (val < 0) { word_define(p, -1); - } else if (cur_val > 127) { + } else if (val > 127) { print_err("Invalid \\endlinechar"); help2 ("The value for \\endlinechar has to be no higher than 127.", "Your invalid assignment will be ignored."); error(); } else { - word_define(p, cur_val); + word_define(p, val); } break; case pdf_compress_level_code: - static_pdf->compress_level = cur_val; - word_define(p, cur_val); + static_pdf->compress_level = val; + word_define(p, val); break; case pdf_objcompresslevel_code: - static_pdf->objcompresslevel = cur_val; - word_define(p, cur_val); + static_pdf->objcompresslevel = val; + word_define(p, val); break; case language_code: - word_define(int_base + cur_lang_code, cur_val); - word_define(p, cur_val); + if (val < 0) { + word_define(int_base + cur_lang_code, -1); + word_define(p, -1); + } else if (val > 16383) { + print_err("Invalid \\language"); + help2 + ("The absolute value for \\language has to be no higher than 16383.", + "Your invalid assignment will be ignored."); + error(); + } else { + word_define(int_base + cur_lang_code, val); + word_define(p, val); + } break; default: - word_define(p, cur_val); + word_define(p, val); break; } /* If we are defining subparagraph penalty levels while we are @@ -2875,22 +2863,22 @@ void assign_internal_value(int a, halfword p, int cur_val) } else if ((p >= dimen_base) && (p <= eqtb_size)) { if (p == (dimen_base + page_left_offset_code)) { - n = cur_val - one_true_inch; + n = val - one_true_inch; word_define(dimen_base + h_offset_code, n); } else if (p == (dimen_base + h_offset_code)) { - n = cur_val + one_true_inch; + n = val + one_true_inch; word_define(dimen_base + page_left_offset_code, n); } else if (p == (dimen_base + page_top_offset_code)) { - n = cur_val - one_true_inch; + n = val - one_true_inch; word_define(dimen_base + v_offset_code, n); } else if (p == (dimen_base + v_offset_code)) { - n = cur_val + one_true_inch; + n = val + one_true_inch; word_define(dimen_base + page_top_offset_code, n); } - word_define(p, cur_val); + word_define(p, val); } else if ((p >= local_base) && (p < toks_base)) { /* internal locals */ - define(p, call_cmd, cur_val); + define(p, call_cmd, val); } else { confusion("assign internal value"); } @@ -3155,10 +3143,10 @@ void new_interaction(void) print_ln(); interaction = cur_chr; if (interaction == batch_mode) - kpsemaketexdiscarderrors = 1; + kpse_make_tex_discard_errors = 1; else - kpsemaketexdiscarderrors = 0; - fixup_selector(log_opened); + kpse_make_tex_discard_errors = 0; + fixup_selector(log_opened_global); } diff --git a/Build/source/texk/web2c/luatexdir/tex/mathcodes.h b/Build/source/texk/web2c/luatexdir/tex/mathcodes.h index bcd02cf940b..6e428775a3c 100644 --- a/Build/source/texk/web2c/luatexdir/tex/mathcodes.h +++ b/Build/source/texk/web2c/luatexdir/tex/mathcodes.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: mathcodes.h 3261 2009-12-18 11:38:21Z taco $ */ +/* $Id: mathcodes.h 4562 2013-01-21 02:58:59Z khaled $ */ #ifndef MATHCODES_H # define MATHCODES_H @@ -26,7 +26,6 @@ # define no_mathcode 0 /* this is a flag for |scan_delimiter| */ # define tex_mathcode 8 -# define aleph_mathcode 16 # define xetex_mathcode 21 # define xetexnum_mathcode 22 diff --git a/Build/source/texk/web2c/luatexdir/tex/mathcodes.w b/Build/source/texk/web2c/luatexdir/tex/mathcodes.w index 2c1d6134495..6317137164f 100644 --- a/Build/source/texk/web2c/luatexdir/tex/mathcodes.w +++ b/Build/source/texk/web2c/luatexdir/tex/mathcodes.w @@ -1,29 +1,29 @@ % mathnodes.w -% +% % Copyright 2006-2012 Taco Hoekwater <taco@@luatex.org> % Copyright 2012 Khaled Hosny <khaledhosny@@eglug.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -#include "ptexlib.h" - static const char _svn_version[] = - "$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 $"; + "$Id: mathcodes.w 4562 2013-01-21 02:58:59Z khaled $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/mathcodes.w $"; + +#include "ptexlib.h" @ math codes @c @@ -79,12 +79,7 @@ static int delcode_heapptr = 0; @ @c void show_mathcode_value(mathcodeval c) { - if (c.origin_value == aleph_mathcode) { - print_char('"'); - print_hex_digit(c.class_value); - two_hex(c.family_value); - four_hex(c.character_value); - } else if (c.origin_value == xetex_mathcode) { + if (c.origin_value == xetex_mathcode) { print_char('"'); print_hex_digit(c.class_value); print_char('"'); @@ -117,9 +112,7 @@ void show_mathcode_value(mathcodeval c) static void show_mathcode(int n) { mathcodeval c = get_math_code(n); - if (c.origin_value == aleph_mathcode) { - tprint_esc("omathcode"); - } else if (c.origin_value == xetex_mathcode) { + if (c.origin_value == xetex_mathcode) { tprint_esc("Umathcode"); } else if (c.origin_value == xetexnum_mathcode) { tprint_esc("Umathcodenum"); @@ -197,8 +190,7 @@ mathcodeval get_math_code(int n) mathcodeval d; d.class_value = 0; d.family_value = 0; - d.origin_value = (n < 256 ? tex_mathcode : - (n < 65536 ? aleph_mathcode : xetex_mathcode)); + d.origin_value = (n < 256 ? tex_mathcode : xetex_mathcode); d.character_value = n; return d; } else { @@ -224,17 +216,7 @@ int get_math_code_num(int n, boolean compat) } else return mval.class_value * 4096 + mval.family_value * 256 + mval.character_value; } else { /* \.{\\the\\Umathcodenum} */ - if (mval.origin_value == tex_mathcode) { - return (mval.class_value * 16 + mval.family_value) * 256 + - mval.character_value; - } else if (mval.origin_value == aleph_mathcode) { - return (mval.class_value * 256 + mval.family_value) * 65536 + - mval.character_value; - } else if (mval.origin_value == xetexnum_mathcode - || mval.origin_value == xetex_mathcode) { - return (mval.class_value + (mval.family_value * 8)) * (65536 * 32) + - mval.character_value; - } + return (mval.class_value + (mval.family_value * 8)) * (65536 * 32) + mval.character_value; } return 0; } @@ -298,8 +280,6 @@ static void show_delcode(int n) c = get_del_code(n); if (c.origin_value == tex_mathcode) { tprint_esc("delcode"); - } else if (c.origin_value == aleph_mathcode) { - tprint_esc("odelcode"); } else if (c.origin_value == xetex_mathcode) { tprint_esc("Udelcode"); } else if (c.origin_value == xetexnum_mathcode) { @@ -317,13 +297,6 @@ static void show_delcode(int n) two_hex(c.small_character_value); print_hex_digit(c.large_family_value); two_hex(c.large_character_value); - } else if (c.origin_value == aleph_mathcode) { - print_char('"'); - two_hex(c.small_family_value); - four_hex(c.small_character_value); - print_char('"'); - two_hex(c.large_family_value); - four_hex(c.large_character_value); } else if (c.origin_value == xetex_mathcode) { print_char('"'); two_hex(c.small_family_value); diff --git a/Build/source/texk/web2c/luatexdir/tex/memoryword.w b/Build/source/texk/web2c/luatexdir/tex/memoryword.w index 7338743ae79..8fbaeab104f 100644 --- a/Build/source/texk/web2c/luatexdir/tex/memoryword.w +++ b/Build/source/texk/web2c/luatexdir/tex/memoryword.w @@ -1,29 +1,28 @@ % memoryword.w -% +% % Copyright 2009-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -#include "ptexlib.h" - static const char _svn_version[] = - "$Id: memoryword.w 3587 2010-04-03 14:32:25Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/tex/memoryword.w $"; + "$Id: memoryword.w 4442 2012-05-25 22:40:34Z hhenkel $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/memoryword.w $"; +#include "ptexlib.h" @ When debugging, we may want to print a |memory_word| without knowing what type it is; so we print it in all modes. diff --git a/Build/source/texk/web2c/luatexdir/tex/mlist.w b/Build/source/texk/web2c/luatexdir/tex/mlist.w index eca4010580b..db4907c8647 100644 --- a/Build/source/texk/web2c/luatexdir/tex/mlist.w +++ b/Build/source/texk/web2c/luatexdir/tex/mlist.w @@ -1,33 +1,32 @@ % mlist.w - +% % Copyright 2006-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. \def\LuaTeX{Lua\TeX} @ @c -#include "ptexlib.h" +static const char _svn_version[] = + "$Id: mlist.w 4595 2013-03-19 14:52:12Z taco $" + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/mlist.w $"; +#include "ptexlib.h" #include "lua/luatex-api.h" -static const char _svn_version[] = - "$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) #define delimiter_shortfall dimen_par(delimiter_shortfall_code) @@ -1163,7 +1162,7 @@ static pointer get_delim_box(extinfo * ext, internal_font_number f, scaled v, a = height_plus_depth(f, cur->glyph); else a = char_width(f, cur->glyph); - assert(a > 0); + assert(a >= 0); } b_max += a - c; prev_overlap = cur->end_overlap; @@ -1182,7 +1181,7 @@ static pointer get_delim_box(extinfo * ext, internal_font_number f, scaled v, a = height_plus_depth(f, cur->glyph); else a = char_width(f, cur->glyph); - assert(a > 0); + assert(a >= 0); } b_max += a - c; prev_overlap = cur->end_overlap; @@ -1799,7 +1798,17 @@ static void make_radical(pointer q, int cur_style) theta = fraction_rule(cur_style); y = var_delimiter(left_delimiter(q), cur_size, height(x) + depth(x) + clr + theta, NULL, cur_style); - theta = height(y); + /* If |y| is a composite then set |theta| to the height of its top + character, else set it to the height of |y|. */ + if (list_ptr(y) != null + && type(list_ptr(y)) == hlist_node + && list_ptr(list_ptr(y)) != null + && type(list_ptr(list_ptr(y))) == glyph_node) { /* and it should be */ + theta = char_height(font(list_ptr(list_ptr(y))), + character(list_ptr(list_ptr(y)))); + } else { + theta = height(y); + } } else { y = var_delimiter(left_delimiter(q), cur_size, height(x) + depth(x) + clr + theta, NULL, cur_style); @@ -1905,19 +1914,19 @@ static void make_over_delimiter(pointer q, int cur_style) static void make_delimiter_over(pointer q, int cur_style) { pointer x, y, v; /* temporary registers for box construction */ - scaled shift_up, shift_down, clr, delta; + scaled shift_up, shift_down, clr, actual; y = clean_box(nucleus(q), cur_style, cur_style); x = flat_delimiter(left_delimiter(q), cur_size + (cur_size == script_script_size ? 0 : 1), width(y), cur_style); left_delimiter(q) = null; fixup_widths(x, y); - shift_up = over_delimiter_bgap(cur_style); + shift_up = over_delimiter_bgap(cur_style)-height(x)-depth(x); shift_down = 0; clr = over_delimiter_vgap(cur_style); - delta = clr - ((shift_up - depth(x)) - (height(y) - shift_down)); - if (delta > 0) { - shift_up = shift_up + delta; + actual = shift_up - height(y); + if (actual < clr) { + shift_up = shift_up + (clr-actual); } v = wrapup_delimiter(x, y, q, shift_up, shift_down); width(v) = width(x); /* this also equals |width(y)| */ @@ -1932,7 +1941,7 @@ static void make_delimiter_over(pointer q, int cur_style) static void make_delimiter_under(pointer q, int cur_style) { pointer x, y, v; /* temporary registers for box construction */ - scaled shift_up, shift_down, clr, delta; + scaled shift_up, shift_down, clr, actual; x = clean_box(nucleus(q), cur_style, cur_style); y = flat_delimiter(left_delimiter(q), cur_size + (cur_size == script_script_size ? 0 : 1), @@ -1940,11 +1949,11 @@ static void make_delimiter_under(pointer q, int cur_style) left_delimiter(q) = null; fixup_widths(x, y); shift_up = 0; - shift_down = under_delimiter_bgap(cur_style); + shift_down = under_delimiter_bgap(cur_style) - height(y)-depth(y); clr = under_delimiter_vgap(cur_style); - delta = clr - ((shift_up - depth(x)) - (height(y) - shift_down)); - if (delta > 0) { - shift_down = shift_down + delta; + actual = shift_down - depth(x); + if (actual<clr) { + shift_down += (clr-actual); } v = wrapup_delimiter(x, y, q, shift_up, shift_down); width(v) = width(y); /* this also equals |width(y)| */ @@ -3209,7 +3218,6 @@ static void mlist_to_hlist(pointer mlist, boolean penalties, int cur_style) int t_subtype; /* the effective |subtype| of noad |q| during the second pass */ pointer p, x, y, z; /* temporary registers for list construction */ int pen; /* a penalty to be inserted */ - int s; /* the size of a noad to be deleted */ scaled max_hl, max_d; /* maximum height and depth of the list translated so far */ scaled delta; /* italic correction offset for subscript and superscript */ scaled cur_mu; /* the math unit width corresponding to |cur_size| */ @@ -3474,7 +3482,6 @@ static void mlist_to_hlist(pointer mlist, boolean penalties, int cur_style) sets up default values so that most of the branches are short. */ t = simple_noad; t_subtype = ord_noad_type; - s = noad_size; pen = inf_penalty; switch (type(q)) { case simple_noad: @@ -3493,15 +3500,12 @@ static void mlist_to_hlist(pointer mlist, boolean penalties, int cur_style) break; } case radical_noad: - s = radical_noad_size; break; case accent_noad: - s = accent_noad_size; break; case fraction_noad: t = simple_noad; t_subtype = inner_noad_type; - s = fraction_noad_size; break; case fence_noad: t_subtype = make_left_right(q, style, max_d, max_hl); @@ -3509,7 +3513,6 @@ static void mlist_to_hlist(pointer mlist, boolean penalties, int cur_style) case style_node: /* Change the current style and |goto delete_q| */ cur_style = subtype(q); - s = style_node_size; setup_cur_size(cur_style); cur_mu = x_over_n(get_math_quad(cur_size), 18); goto DELETE_Q; diff --git a/Build/source/texk/web2c/luatexdir/tex/nesting.w b/Build/source/texk/web2c/luatexdir/tex/nesting.w index 8e9577b84e3..932cf3cca94 100644 --- a/Build/source/texk/web2c/luatexdir/tex/nesting.w +++ b/Build/source/texk/web2c/luatexdir/tex/nesting.w @@ -1,29 +1,28 @@ % nesting.w -% +% % Copyright 2009-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along -% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. +% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -#include "ptexlib.h" - static const char _svn_version[] = - "$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 $"; + "$Id: nesting.w 4442 2012-05-25 22:40:34Z hhenkel $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/nesting.w $"; +#include "ptexlib.h" @ these are for |show_activities| @c diff --git a/Build/source/texk/web2c/luatexdir/tex/packaging.h b/Build/source/texk/web2c/luatexdir/tex/packaging.h index c10a715695a..6e57ed57459 100644 --- a/Build/source/texk/web2c/luatexdir/tex/packaging.h +++ b/Build/source/texk/web2c/luatexdir/tex/packaging.h @@ -1,4 +1,4 @@ -/* nesting.h +/* packaging.h Copyright 2009 Taco Hoekwater <taco@luatex.org> @@ -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 4044 2010-12-18 09:23:06Z taco $ */ +/* $Id: packaging.h 4445 2012-05-25 23:18:09Z hhenkel $ */ #ifndef PACKAGING_H # define PACKAGING_H diff --git a/Build/source/texk/web2c/luatexdir/tex/packaging.w b/Build/source/texk/web2c/luatexdir/tex/packaging.w index 2de2d13f99d..d3027d3a1e6 100644 --- a/Build/source/texk/web2c/luatexdir/tex/packaging.w +++ b/Build/source/texk/web2c/luatexdir/tex/packaging.w @@ -1,28 +1,28 @@ % packaging.w - +% % Copyright 2009-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along -% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. +% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -#include "ptexlib.h" - static const char _svn_version[] = - "$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 $"; + "$Id: packaging.w 4457 2012-07-13 13:16:19Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/packaging.w $"; + +#include "ptexlib.h" @ @c #define scan_normal_dimen() scan_dimen(false,false,false) @@ -422,8 +422,7 @@ 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 */ - halfword dir_ptr; /* for managing the direction stack */ - /* BEWARE: this shadows a global |dir_ptr| */ + halfword dir_ptr1; /* for managing the direction stack */ int hpack_dir; /* the current direction */ int disc_level; halfword pack_interrupt[8]; @@ -438,8 +437,8 @@ halfword hpack(halfword p, scaled w, int m, int pack_direction) box_dir(r) = pack_direction; } hpack_dir = box_dir(r); - dir_ptr = null; - push_dir(hpack_dir); + dir_ptr1 = null; + push_dir(hpack_dir,dir_ptr1); q = r + list_offset; vlink(q) = p; if (m == cal_expand_ratio) { @@ -563,11 +562,11 @@ halfword hpack(halfword p, scaled w, int m, int pack_direction) /* DIR: Adjust the dir stack for the |hpack| routine */ if (dir_dir(p) >= 0) { hpack_dir = dir_dir(p); - push_dir_node(p); + push_dir_node(p,dir_ptr1); } else { - pop_dir_node(); - if (dir_ptr != null) - hpack_dir = dir_dir(dir_ptr); + pop_dir_node(dir_ptr1); + if (dir_ptr1 != null) + hpack_dir = dir_dir(dir_ptr1); } } else { @@ -600,7 +599,7 @@ halfword hpack(halfword p, scaled w, int m, int pack_direction) break; case margin_kern_node: if (m == cal_expand_ratio) { - f = font(margin_char(p)); + int f = font(margin_char(p)); do_subst_font(margin_char(p), 1000); if (f != font(margin_char(p))) font_stretch = @@ -823,8 +822,8 @@ halfword hpack(halfword p, scaled w, int m, int pack_direction) flush_node(r); r = hpack(q, w, subst_ex_font, hpack_dir); } - while (dir_ptr != null) - pop_dir_node(); + while (dir_ptr1 != null) + pop_dir_node(dir_ptr1); return r; } diff --git a/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w b/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w index f96fd1cf861..cf1144ff570 100644 --- a/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w +++ b/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w @@ -1,28 +1,28 @@ % postlinebreak.w -% +% % Copyright 2006-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along -% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. +% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -#include "ptexlib.h" - static const char _svn_version[] = - "$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 $"; + "$Id: postlinebreak.w 4457 2012-07-13 13:16:19Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/postlinebreak.w $"; + +#include "ptexlib.h" @ 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 @@ -85,8 +85,8 @@ void ext_post_line_break(int paragraph_dir, { boolean have_directional = true; - halfword q, r, s; /* temporary registers for list manipulation */ - halfword p, k; + halfword q, r; /* temporary registers for list manipulation */ + halfword k; scaled w; boolean glue_break; /* was a break at glue? */ boolean disc_break; /*was the current break at a discretionary node? */ @@ -307,7 +307,7 @@ void ext_post_line_break(int paragraph_dir, /* If the par ends with a \break command, the last line is utterly empty. That is the case of |q==temp_head| */ if (q != temp_head && pdf_protrude_chars > 0) { - halfword ptmp; + halfword p, ptmp; if (disc_break && (is_char_node(q) || (type(q) != disc_node))) { p = q; /* |q| has been reset to the last node of |pre_break| */ ptmp = p; @@ -333,15 +333,15 @@ void ext_post_line_break(int paragraph_dir, then we append |rightskip| after |q| now */ if (!glue_break) { /* 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+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)); - couple_nodes(q,r); - q = r; + halfword r1 = new_glue((right_skip == null ? null : copy_node(right_skip))); + glue_ref_count(glue_ptr(r1)) = null; + subtype(r1) = right_skip_code+1; + try_couple_nodes(r1,vlink(q)); + delete_attribute_ref(node_attr(r1)); + node_attr(r1) = node_attr(q); + add_node_attr_ref(node_attr(r1)); + couple_nodes(q,r1); + q = r1; } /* /Modify the end of the line to reflect the nature of the break and to @@ -358,6 +358,7 @@ void ext_post_line_break(int paragraph_dir, try_couple_nodes(temp_head, r); if (passive_left_box(cur_p) != null && passive_left_box(cur_p) != 0) { /* omega bits: */ + halfword s; r = copy_node_list(passive_left_box(cur_p)); s = vlink(q); couple_nodes(r,q); @@ -374,6 +375,7 @@ void ext_post_line_break(int paragraph_dir, } /*at this point |q| is the leftmost node; all discardable nodes have been discarded */ if (pdf_protrude_chars > 0) { + halfword p; p = q; p = find_protchar_left(p, false); /* no more discardables */ w = char_pw(p, left_side); diff --git a/Build/source/texk/web2c/luatexdir/tex/primitive.h b/Build/source/texk/web2c/luatexdir/tex/primitive.h index 08459aa014f..b00a6b770ed 100644 --- a/Build/source/texk/web2c/luatexdir/tex/primitive.h +++ b/Build/source/texk/web2c/luatexdir/tex/primitive.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: primitive.h 3385 2010-01-26 05:45:55Z taco $ */ +/* $Id: primitive.h 4564 2013-01-21 13:25:53Z khaled $ */ #ifndef LUATEX_PRIMITIVE_H # define LUATEX_PRIMITIVE_H 1 @@ -33,6 +33,7 @@ typedef enum { luatex_command = 32, core_command = 64, no_command = 128, + umath_command = 256, } command_origin; # define hash_size 65536 /* maximum number of control sequences; it should be at most about |(fix_mem_max-fix_mem_min)/10| */ @@ -78,6 +79,7 @@ extern void undump_primitives(void); # define primitive_omega(a,b,c,d) primitive((a),(b),(c),(d),omega_command) # define primitive_pdftex(a,b,c,d) primitive((a),(b),(c),(d),pdftex_command) # define primitive_luatex(a,b,c,d) primitive((a),(b),(c),(d),luatex_command) +# define primitive_umath(a,b,c,d) primitive((a),(b),(c),(d),umath_command) # define primitive_core(a,b,c,d) primitive((a),(b),(c),(d),core_command) # define primitive_no(a,b,c,d) primitive((a),(b),(c),(d),no_command) diff --git a/Build/source/texk/web2c/luatexdir/tex/primitive.w b/Build/source/texk/web2c/luatexdir/tex/primitive.w index 3fd3f4ff9fa..4e202f114ed 100644 --- a/Build/source/texk/web2c/luatexdir/tex/primitive.w +++ b/Build/source/texk/web2c/luatexdir/tex/primitive.w @@ -1,30 +1,28 @@ % primitive.w - +% % Copyright 2008-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -#include "ptexlib.h" - - static const char _svn_version[] = - "$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 $"; + "$Id: primitive.w 4562 2013-01-21 02:58:59Z khaled $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/primitive.w $"; +#include "ptexlib.h" @ Control sequences are stored and retrieved by means of a fairly standard hash table algorithm called the method of ``coalescing lists'' (cf.\ Algorithm 6.4C @@ -562,10 +560,6 @@ void print_cmd_chr(quarterword cmd, halfword chr_code) tprint_esc("mathchar"); show_mathcode_value(mathchar_from_integer(chr_code, tex_mathcode)); break; - case omath_given_cmd: - tprint_esc("omathchar"); - show_mathcode_value(mathchar_from_integer(chr_code, aleph_mathcode)); - break; case xmath_given_cmd: tprint_esc("Umathchar"); show_mathcode_value(mathchar_from_integer(chr_code, xetex_mathcode)); diff --git a/Build/source/texk/web2c/luatexdir/tex/printing.h b/Build/source/texk/web2c/luatexdir/tex/printing.h index b104fd142cc..1815f4fbd4b 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 3436 2010-02-21 15:34:00Z taco $ */ +/* $Id: printing.h 4563 2013-01-21 03:22:53Z khaled $ */ #ifndef PRINTING_H # define PRINTING_H @@ -62,7 +62,6 @@ extern void print_char(int s); extern void print(int s); extern void print_nl(str_number s); extern void print_nlp(void); -extern void slow_print(int s); extern void print_banner(const char *, int, int); extern void log_banner(const char *, int, int); extern void print_version_banner(void); @@ -91,7 +90,7 @@ extern void prompt_input(const char *s); ((str_length(A)==3)&&*(str_string((A)))>=0xE0)|| \ ((str_length(A)==2)&&*(str_string((A)))>=0xC0)) -# define is_active_cs(a) (str_length(a)>3 && \ +# define is_active_cs(a) (a && str_length(a)>3 && \ (*str_string(a) == 0xEF) && \ (*(str_string(a)+1) == 0xBF) && \ (*(str_string(a)+2) == 0xBF)) diff --git a/Build/source/texk/web2c/luatexdir/tex/printing.w b/Build/source/texk/web2c/luatexdir/tex/printing.w index 09e05aa23c2..524dd26512a 100644 --- a/Build/source/texk/web2c/luatexdir/tex/printing.w +++ b/Build/source/texk/web2c/luatexdir/tex/printing.w @@ -1,30 +1,30 @@ % printing.w - -% Copyright 2009-2012 Taco Hoekwater <taco@@luatex.org> - +% +% Copyright 2009-2011 Taco Hoekwater <taco@@luatex.org> +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c +static const char _svn_version[] = + "$Id: printing.w 4593 2013-03-19 14:25:17Z taco $" + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/printing.w $"; + #include "ptexlib.h" #include "lua/luatex-api.h" /* for ptexbanner */ -static const char _svn_version[] = - "$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)) @@ -83,7 +83,7 @@ int trick_count; /* threshold for pseudoprinting, explained later int first_count; /* another variable for pseudoprinting */ boolean inhibit_par_tokens = false; /* for minor adjustments to |show_token_list| */ -@ To end a line of text output, we call |print_ln| +@ To end a line of text output, we call |print_ln| @c void print_ln(void) { /* prints an end-of-line */ @@ -114,12 +114,13 @@ void print_ln(void) @ The |print_char| procedure sends one byte to the desired destination. - All printing comes through |print_ln| or |print_char|. + All printing comes through |print_ln| or |print_char|, except for the + case of |tprint| (see below). @c #define wterm_char(A) do { \ if ((A>=0x20)||(A==0x0A)||(A==0x0D)||(A==0x09)) { \ - wterm(A); \ + wterm(A); \ } else { \ if (term_offset+2>=max_print_line) { \ wterm_cr(); term_offset=0; \ @@ -131,9 +132,9 @@ void print_ln(void) } while (0) #define needs_wrapping(A,B) \ - (((A>=0xC0)&&(A<=0xDF)&&(B+2>=max_print_line))|| \ - ((A>=0xE0)&&(A<=0xEF)&&(B+3>=max_print_line))|| \ - ((A>=0xF0)&&(B+4>=max_print_line))) + (((A>=0xF0)&&(B+4>=max_print_line))|| \ + ((A>=0xE0)&&(B+3>=max_print_line))|| \ + ((A>=0xC0)&&(B+2>=max_print_line))) #define fix_term_offset(A) do { \ if (needs_wrapping(A,term_offset)){ \ @@ -319,18 +320,126 @@ void print_nl(str_number s) print(s); } -@ |char *| versions of the same procedures +@ |char *| versions of the same procedures. |tprint| is +different because it uses buffering, which works well because +most of the output actually comes through |tprint|. @c -void tprint(const char *s) +void tprint(const char *sss) { - const unsigned char *ss = (const unsigned char *) s; - if (selector == new_string) { - append_string(ss, (unsigned) strlen(s)); + char *buffer = NULL; + int i = 0; /* buffer index */ + int newlinechar = int_par(new_line_char_code); + int dolog = 0; + int doterm = 0; + switch (selector) { + case new_string: + append_string((const unsigned char *)sss, (unsigned) strlen(sss)); return; + break; + case pseudo: + while (*sss) { + if (tally++ < trick_count) { + trick_buf[tally % error_line] = (packed_ASCII_code) *sss++; + } else { + return; + } + } + return; + break; + case no_print: + return; + break; + case term_and_log: + dolog = 1; + doterm = 1; + break; + case log_only: + dolog = 1; + break; + case term_only: + doterm = 1; + break; + default: + { + char *newstr = xstrdup(sss); + char *s; + for (s=newstr;*s;s++) { + if (*s == newlinechar) { + *s = '\n'; + } + } + fputs(newstr, write_file[selector]); + free(newstr); + return; + } + break; + } + /* what is left is the 3 term/log settings */ + buffer = xmalloc(strlen(sss)*3); + if (dolog) { + const unsigned char *ss = (const unsigned char *) sss; + while (*ss) { + int s = *ss++; + if (needs_wrapping(s,file_offset) || s == newlinechar) { + buffer[i++] = '\n'; + buffer[i++] = '\0'; + fputs(buffer, log_file); + i = 0; buffer[0] = '\0'; + file_offset=0; + } + if (s != newlinechar) { + buffer[i++] = s; + if (file_offset++ == max_print_line) { + buffer[i++] = '\n'; + buffer[i++] = '\0'; + fputs(buffer, log_file); + i = 0; buffer[0] = '\0'; + file_offset = 0; + } + } + } + if (*buffer) { + buffer[i++] = '\0'; + fputs(buffer, log_file); + buffer[0] = '\0'; + } + i = 0; + } + if (doterm) { + while (*sss) { + int s = *sss++; + if (needs_wrapping(s,term_offset) || s == newlinechar) { + buffer[i++] = '\n'; + buffer[i++] = '\0'; + fputs(buffer, term_out); + i = 0; buffer[0] = '\0'; + term_offset=0; + } + if (s != newlinechar) { + if ((s>=0x20)||(s==0x0A)||(s==0x0D)||(s==0x09)) { + buffer[i++] = s; + } else { + buffer[i++] = '^'; + buffer[i++] = '^'; + buffer[i++] = s+64; + term_offset += 2; + } + if (term_offset++ == max_print_line) { + buffer[i++] = '\n'; + buffer[i++] = '\0'; + fputs(buffer, term_out); + i = 0; buffer[0] = '\0'; + term_offset = 0; + } + } + } + if (*buffer) { + buffer[i++] = '\0'; + fputs(buffer, term_out); + } } - while (*ss) - print_char(*ss++); + free(buffer); } void tprint_nl(const char *s) @@ -339,14 +448,6 @@ void tprint_nl(const char *s) tprint(s); } -@ |slow_print| is the same as |print| nowadays, but the name is kept for now. - -@c -void slow_print(int s) -{ /* prints string |s| */ - print(s); -} - @ Here is the very first thing that \TeX\ prints: a headline that identifies the version number and format package. The |term_offset| variable is temporarily incorrect, but the discrepancy is not serious since we assume that the banner @@ -356,13 +457,16 @@ character positions. @c void print_banner(const char *v, int e, int ver) { - boolean res; int callback_id; callback_id = callback_defined(start_run_callback); if (callback_id == 0) { - fprintf(term_out, "This is LuaTeX, Version %s-%d" WEB2CVERSION, v, e); + if (ver < 0) + fprintf(term_out, "This is LuaTeX, Version %s-%d ", v, e); + else + fprintf(term_out, "This is LuaTeX, Version %s-%d (rev %d) ", v, e, + ver); if (format_ident > 0) - slow_print(format_ident); + print(format_ident); print_ln(); if (shellenabledp) { wterm(' '); @@ -371,7 +475,7 @@ void print_banner(const char *v, int e, int ver) fprintf(term_out, "\\write18 enabled.\n"); } } else if (callback_id > 0) { - res = run_callback(callback_id, "->"); + run_callback(callback_id, "->"); } } @@ -385,13 +489,16 @@ void log_banner(const char *v, int e, int ver) unsigned month = (unsigned) int_par(month_code); if (month > 12) month = 0; - fprintf(log_file, "This is LuaTeX, Version %s-%d" WEB2CVERSION, v, e); - slow_print(format_ident); + if (ver < 0) + fprintf(log_file, "This is LuaTeX, Version %s-%d ", v, e); + else + fprintf(log_file, "This is LuaTeX, Version %s-%d (rev %d) ", v, e, ver); + print(format_ident); print_char(' '); print_char(' '); print_int(int_par(day_code)); print_char(' '); - fprintf(log_file, months[month]); + fprintf(log_file, "%s", months[month]); print_char(' '); print_int(int_par(year_code)); print_char(' '); @@ -418,7 +525,7 @@ void log_banner(const char *v, int e, int ver) @ @c void print_version_banner(void) { - fprintf(term_out, ptexbanner); + fprintf(term_out, "%s", ptexbanner); } @ The procedure |print_esc| prints a string that is preceded by @@ -635,7 +742,7 @@ void sprint_cs(pointer p) } -@ This procedure is never called when |interaction<scroll_mode|. +@ This procedure is never called when |interaction<scroll_mode|. @c void prompt_input(const char *s) { @@ -665,7 +772,7 @@ void print_glue(scaled d, int order, const char *s) } } -@ The next subroutine prints a whole glue specification +@ The next subroutine prints a whole glue specification @c void print_spec(int p, const char *s) { /* prints a glue specification */ @@ -827,7 +934,7 @@ int depth_threshold; /* maximum nesting depth in box displays */ int breadth_max; /* maximum number of items shown at the same list level */ -@ The recursive machinery is started by calling |show_box|. +@ The recursive machinery is started by calling |show_box|. @c void show_box(halfword p) diff --git a/Build/source/texk/web2c/luatexdir/tex/scanning.w b/Build/source/texk/web2c/luatexdir/tex/scanning.w index 8f06bb5f6dc..f17ee785003 100644 --- a/Build/source/texk/web2c/luatexdir/tex/scanning.w +++ b/Build/source/texk/web2c/luatexdir/tex/scanning.w @@ -1,29 +1,28 @@ % scanning.w -% +% % Copyright 2009-2012 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -#include "ptexlib.h" - static const char _svn_version[] = - "$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 $"; + "$Id: scanning.w 4562 2013-01-21 02:58:59Z khaled $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/scanning.w $"; +#include "ptexlib.h" @ @c #define prev_depth cur_list.prev_depth_field @@ -308,7 +307,6 @@ static boolean short_scan_something_internal(int cmd, int chr, int level, break; case char_given_cmd: case math_given_cmd: - case omath_given_cmd: case xmath_given_cmd: scanned_result(cur_chr, int_val_level); break; @@ -464,21 +462,9 @@ static boolean short_scan_something_internal(int cmd, int chr, int level, case pdf_last_link_code: cur_val = pdf_last_link; break; - case Aleph_version_code: - cur_val = Aleph_version; - break; - case Omega_version_code: - cur_val = Omega_version; - break; case eTeX_version_code: cur_val = eTeX_version; break; - case Aleph_minor_version_code: - cur_val = Aleph_minor_version; - break; - case Omega_minor_version_code: - cur_val = Omega_minor_version; - break; case eTeX_minor_version_code: cur_val = eTeX_minor_version; break; diff --git a/Build/source/texk/web2c/luatexdir/tex/stringpool.h b/Build/source/texk/web2c/luatexdir/tex/stringpool.h index 21e031acc86..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 3802 2010-08-07 12:03:08Z taco $ */ +/* $Id: stringpool.h 4599 2013-03-19 15:41:07Z taco $ */ #ifndef STRINGPOOL_H # define STRINGPOOL_H @@ -56,8 +56,6 @@ extern str_number init_str_ptr; a simple macro that computes the length of a string. */ -# define utf8_size(a) (a>0xFFFF ? 4 : (a>0x7FF ? 3 : (a>0x7F? 2 : 1))) - # define str_length(a) string_pool[(a)-STRING_OFFSET].l # define str_string(a) string_pool[(a)-STRING_OFFSET].s # define str_lstring(a) string_pool[(a)-STRING_OFFSET] @@ -128,9 +126,6 @@ extern void reset_cur_string(void); extern str_number search_string(str_number search); extern int pool_to_unichar(unsigned char *t); -extern unsigned char *uni2str(unsigned); -extern unsigned str2uni(const unsigned char *); - extern str_number maketexstring(const char *); extern str_number maketexlstring(const char *, size_t); extern void append_string(const unsigned char *s, unsigned l); diff --git a/Build/source/texk/web2c/luatexdir/tex/stringpool.w b/Build/source/texk/web2c/luatexdir/tex/stringpool.w index 29dc6be9132..990c619d7f2 100644 --- a/Build/source/texk/web2c/luatexdir/tex/stringpool.w +++ b/Build/source/texk/web2c/luatexdir/tex/stringpool.w @@ -1,28 +1,28 @@ % stringpool.w -% +% % Copyright 2009-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -#include "ptexlib.h" - static const char _svn_version[] = - "$Id: stringpool.w 3587 2010-04-03 14:32:25Z taco $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/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" @ Control sequence names and diagnostic messages are variable-length strings of eight-bit characters. Since PASCAL did not have a well-developed string @@ -95,143 +95,6 @@ str_number make_string(void) } @ @c -static void utf_error(void) -{ - const char *hlp[] = - { "A funny symbol that I can't read has just been (re)read.", - "Just continue, I'll change it to 0xFFFD.", - NULL - }; - deletions_allowed = false; - tex_error("String contains an invalid utf-8 sequence", hlp); - deletions_allowed = true; -} - -@ @c -unsigned str2uni(const unsigned char *k) -{ - register int ch; - unsigned val = 0xFFFD; - const unsigned char *text = k; - if ((ch = *text++) < 0x80) { - val = (unsigned) ch; - } else if (ch <= 0xbf) { /* error */ - } else if (ch <= 0xdf) { - if (*text >= 0x80 && *text < 0xc0) - val = (unsigned) (((ch & 0x1f) << 6) | (*text++ & 0x3f)); - } else if (ch <= 0xef) { - if (*text >= 0x80 && *text < 0xc0 && text[1] >= 0x80 && text[1] < 0xc0) { - val = (unsigned) - (((ch & 0xf) << 12) | ((text[0] & 0x3f) << 6) | - (text[1] & 0x3f)); - } - } else { - int w = (((ch & 0x7) << 2) | ((text[0] & 0x30) >> 4)) - 1, w2; - w = (w << 6) | ((text[0] & 0xf) << 2) | ((text[1] & 0x30) >> 4); - w2 = ((text[1] & 0xf) << 6) | (text[2] & 0x3f); - val = (unsigned) (w * 0x400 + w2 + 0x10000); - if (*text < 0x80 || text[1] < 0x80 || text[2] < 0x80 || - *text >= 0xc0 || text[1] >= 0xc0 || text[2] >= 0xc0) - val = 0xFFFD; - } - if (val == 0xFFFD) - utf_error(); - return (val); -} - -@ This is a very basic helper -@c -unsigned char *uni2str(unsigned unic) -{ - unsigned char *buf = xmalloc(5); - unsigned char *pt = buf; - if (unic < 0x80) - *pt++ = (unsigned char) unic; - else if (unic < 0x800) { - *pt++ = (unsigned char) (0xc0 | (unic >> 6)); - *pt++ = (unsigned char) (0x80 | (unic & 0x3f)); - } else if (unic >= 0x110000) { - *pt++ = (unsigned char) (unic - 0x110000); - } else if (unic < 0x10000) { - *pt++ = (unsigned char) (0xe0 | (unic >> 12)); - *pt++ = (unsigned char) (0x80 | ((unic >> 6) & 0x3f)); - *pt++ = (unsigned char) (0x80 | (unic & 0x3f)); - } else { - int u, z, y, x; - unsigned val = unic - 0x10000; - u = (int) (((val & 0xf0000) >> 16) + 1); - z = (int) ((val & 0x0f000) >> 12); - y = (int) ((val & 0x00fc0) >> 6); - x = (int) (val & 0x0003f); - *pt++ = (unsigned char) (0xf0 | (u >> 2)); - *pt++ = (unsigned char) (0x80 | ((u & 3) << 4) | z); - *pt++ = (unsigned char) (0x80 | y); - *pt++ = (unsigned char) (0x80 | x); - } - *pt = '\0'; - return buf; -} - - -@ |buffer_to_unichar| converts a sequence of bytes in the |buffer| -into a unicode character value. It does not check for overflow -of the |buffer|, but it is careful to check the validity of the -UTF-8 encoding. - -@c -#define test_sequence_byte(A) do { \ - if (((A)<0x80) || ((A)>=0xC0)) { \ - utf_error(); \ - return 0xFFFD; \ - } \ - } while (0) - - -static int buffer_to_unichar(int k) -{ - int a; /* a utf char */ - int b; /* a utf nibble */ - b = buffer[k]; - if (b < 0x80) { - a = b; - } else if (b >= 0xF8) { - /* the 5- and 6-byte UTF-8 sequences generate integers - that are outside of the valid UCS range, and therefore - unsupported - */ - test_sequence_byte(-1); - } else if (b >= 0xF0) { - a = (b - 0xF0) * 64; - b = buffer[k + 1]; - test_sequence_byte(b); - a = (a + (b - 128)) * 64; - b = buffer[k + 2]; - test_sequence_byte(b); - a = (a + (b - 128)) * 64; - b = buffer[k + 3]; - test_sequence_byte(b); - a = a + (b - 128); - } else if (b >= 0xE0) { - a = (b - 0xE0) * 64; - b = buffer[k + 1]; - test_sequence_byte(b); - a = (a + (b - 128)) * 64; - b = buffer[k + 2]; - test_sequence_byte(b); - a = a + (b - 128); - } else if (b >= 0xC0) { - a = (b - 0xC0) * 64; - b = buffer[k + 1]; - test_sequence_byte(b); - a = a + (b - 128); - } else { - /* This is an encoding error */ - test_sequence_byte(-1); - } - return a; -} - -@ @c int pool_to_unichar(unsigned char *t) { return (int) str2uni(t); diff --git a/Build/source/texk/web2c/luatexdir/tex/texdeffont.w b/Build/source/texk/web2c/luatexdir/tex/texdeffont.w index eab44838beb..c5bcfe5ff3f 100644 --- a/Build/source/texk/web2c/luatexdir/tex/texdeffont.w +++ b/Build/source/texk/web2c/luatexdir/tex/texdeffont.w @@ -1,29 +1,28 @@ % texdeffont.w - +% % Copyright 2008-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along -% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. +% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -#include "ptexlib.h" - static const char _svn_version[] = - "$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 $"; - + "$Id: texdeffont.w 4520 2012-12-14 09:15:55Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/texdeffont.w $"; +#include "ptexlib.h" @ When the user defines \.{\\font\\f}, say, \TeX\ assigns an internal number to the user's font~\.{\\f}. Adding this number to |font_id_base| gives the @@ -52,15 +51,15 @@ static char *scaled_to_string(scaled s) } { int l = 0; - char dig[8] = { 0 }; + char digs[8] = { 0 }; n = s / unity; /* process the integer part */ do { - dig[l++] = (char) (n % 10); + digs[l++] = (char) (n % 10); n = n / 10;; } while (n > 0); while (l > 0) { - result[k++] = (char) (dig[--l] + '0'); + result[k++] = (char) (digs[--l] + '0'); } } result[k++] = '.'; @@ -85,7 +84,6 @@ void tex_def_font(small_number a) internal_font_number f; /* runs through existing fonts */ str_number t; /* name for the frozen font identifier */ int old_setting; /* holds |selector| setting */ - int offset = 0; scaled s = -1000; /* stated ``at'' size, or negative of scaled magnification */ int natural_dir = -1; /* the natural direction of the font */ char *fn; @@ -177,19 +175,6 @@ void tex_def_font(small_number a) s = -1000; } } - if (scan_keyword("offset")) { - scan_int(); - offset = cur_val; - if (cur_val < 0) { - char err[256]; - const char *errhelp[] = - { "The offset must be bigger than 0.", NULL }; - snprintf(err, 255, "Illegal offset has been changed to 0 (%d)", - (int) cur_val); - tex_error(err, errhelp); - offset = 0; - } - } if (scan_keyword("naturaldir")) { scan_direction(); natural_dir = cur_val; @@ -198,15 +183,6 @@ void tex_def_font(small_number a) fn = makecstring(cur_name); f = read_font_info(u, fn, s, natural_dir); xfree(fn); -/* - The new code seems not to work. - if (a >= 4) { - geq_define(u, set_font_cmd, null_font); - } else { - eq_define(u, set_font_cmd, null_font); - } - Therefore the old code is used here. -*/ equiv(u) = f; eqtb[font_id_base + f] = eqtb[u]; diff --git a/Build/source/texk/web2c/luatexdir/tex/texfileio.h b/Build/source/texk/web2c/luatexdir/tex/texfileio.h index 7b2b17b2d53..d0f5c45e5c4 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 4255 2011-05-09 11:48:02Z taco $ */ +/* $Id: texfileio.h 4521 2012-12-14 13:54:54Z taco $ */ #ifndef TEXFILEIO_H # define TEXFILEIO_H @@ -25,7 +25,6 @@ extern int *input_file_callback_id; extern int read_file_callback_id[17]; -extern char *luatex_find_file(const char *s, int callback_index); extern char *luatex_find_read_file(const char *s, int n, int callback_index); extern boolean luatex_open_input(FILE ** f_ptr, const char *fn, int filefmt, const_string fopen_mode, boolean must_exist); @@ -111,7 +110,7 @@ extern char *open_fmt_file(void); extern boolean name_in_progress; /* is a file name being scanned? */ extern str_number job_name; /* principal file name */ -extern boolean log_opened; /* has the transcript file been opened? */ +extern boolean log_opened_global; /* has the transcript file been opened? */ extern unsigned char *texmf_log_name; /* full name of the log file */ @@ -126,8 +125,6 @@ extern boolean zopen_w_input(FILE **, const char *, int, extern boolean zopen_w_output(FILE **, const char *, const_string fopen_mode); extern void zwclose(FILE *); -extern int readbinfile(FILE * f, unsigned char **b, int *s); - # define read_tfm_file readbinfile # define read_vf_file readbinfile # define read_data_file readbinfile diff --git a/Build/source/texk/web2c/luatexdir/tex/texfileio.w b/Build/source/texk/web2c/luatexdir/tex/texfileio.w index 4607e3ec7cd..875adb4a3b8 100644 --- a/Build/source/texk/web2c/luatexdir/tex/texfileio.w +++ b/Build/source/texk/web2c/luatexdir/tex/texfileio.w @@ -1,31 +1,31 @@ % texfileio.w -% +% % Copyright 2009-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c +static const char _svn_version[] = + "$Id: texfileio.w 4521 2012-12-14 13:54:54Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/texfileio.w $"; + #include <string.h> #include "ptexlib.h" #include <kpathsea/absolute.h> -static const char _svn_version[] = - "$Id: texfileio.w 4272 2011-05-17 14:10:30Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.70.x/source/texk/web2c/luatexdir/tex/texfileio.w $"; - @ @c #define end_line_char int_par(end_line_char_code) @@ -179,6 +179,9 @@ char *luatex_find_file(const char *s, int callback_index) if (ftemp == NULL) ftemp = kpse_find_file(s, kpse_vf_format, 0); break; + case find_cidmap_file_callback: + ftemp = kpse_find_file(s, kpse_cid_format, 0); + break; default: printf ("luatex_find_file(): do not know how to handle file %s of type %d\n", @@ -371,14 +374,13 @@ boolean lua_b_open_out(alpha_file * f, char *fn) @ @c void lua_a_close_in(alpha_file f, int n) { /* close a text file */ - boolean ret; int callback_id; if (n == 0) callback_id = input_file_callback_id[iindex]; else callback_id = read_file_callback_id[n]; if (callback_id > 0) { - ret = run_saved_callback(callback_id, "close", "->"); + run_saved_callback(callback_id, "close", "->"); destroy_saved_callback(callback_id); if (n == 0) input_file_callback_id[iindex] = 0; @@ -777,7 +779,7 @@ and `\.{.fmt}' in the names of \TeX's output files. @c boolean name_in_progress; /* is a file name being scanned? */ str_number job_name; /* principal file name */ -boolean log_opened; /* has the transcript file been opened? */ +boolean log_opened_global; /* has the transcript file been opened? */ @ Initially |job_name=0|; it becomes nonzero as soon as the true name is known. @@ -824,7 +826,7 @@ void open_log_file(void) } texmf_log_name = (unsigned char *) xstrdup(fn); selector = log_only; - log_opened = true; + log_opened_global = true; if (callback_defined(start_run_callback) == 0) { /* Print the banner line, including the date and time */ log_banner(luatex_version_string, luatex_date_info, luatex_svn); @@ -1271,7 +1273,7 @@ static FILE *runpopen(char *cmd, const char *mode) @c #define NUM_PIPES 16 static FILE *pipes[NUM_PIPES]; - + #ifdef WIN32 FILE *Poptr; #endif diff --git a/Build/source/texk/web2c/luatexdir/tex/texmath.w b/Build/source/texk/web2c/luatexdir/tex/texmath.w index 2adf03c5cec..cadbbb02536 100644 --- a/Build/source/texk/web2c/luatexdir/tex/texmath.w +++ b/Build/source/texk/web2c/luatexdir/tex/texmath.w @@ -1,28 +1,28 @@ % texmath.w - +% % Copyright 2008-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -#include "ptexlib.h" - static const char _svn_version[] = - "$Id: texmath.w 4170 2011-04-16 13:16:39Z taco $ " - "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.70.x/source/texk/web2c/luatexdir/tex/texmath.w $"; + "$Id: texmath.w 4566 2013-01-22 13:18:15Z khaled $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/texmath.w $"; + +#include "ptexlib.h" @ @c #define mode cur_list.mode_field @@ -396,13 +396,13 @@ pointer new_noad(void) } @ @c -pointer new_sub_box(pointer cur_box) +pointer new_sub_box(pointer curbox) { pointer p, q; p = new_noad(); q = new_node(sub_box_node, 0); nucleus(p) = q; - math_list(nucleus(p)) = cur_box; + math_list(nucleus(p)) = curbox; return p; } @@ -596,12 +596,6 @@ static void print_delimiter(pointer p) /* modern xetex/luatex style */ print_hex(small_fam(p)); print_hex(small_char(p)); - } else { - /* assume this is omega-style */ - a = small_fam(p) * 65536 + small_char(p); - print_hex(a); - a = large_fam(p) * 65536 + large_char(p); - print_hex(a); } } @@ -1035,7 +1029,7 @@ void enter_display_math(void) } @ The next routine parses all variations of a delimiter code. The |extcode| - tells what syntax form to use (\TeX, Aleph, XeTeX, XeTeXnum, ...) , the + tells what syntax form to use (\TeX, XeTeX, XeTeXnum, ...) , the |doclass| tells whether or not read a math class also (for \.{\\delimiter} c.s.). (the class is passed on for conversion to \.{\\mathchar}). @@ -1049,7 +1043,6 @@ static delcodeval do_scan_extdef_del_code(int extcode, boolean doclass) NULL }; delcodeval d; - int cur_val1; /* and the global |cur_val| */ int mcls, msfam = 0, mschr = 0, mlfam = 0, mlchr = 0; mcls = 0; if (extcode == tex_mathcode) { /* \.{\\delcode}, this is the easiest */ @@ -1067,24 +1060,6 @@ static delcodeval do_scan_extdef_del_code(int extcode, boolean doclass) mschr = (cur_val % 0x100000) / 0x1000; mlfam = (cur_val & 0xFFF) / 0x100; mlchr = (cur_val % 0x100); - } else if (extcode == aleph_mathcode) { /* \.{\\odelcode} */ - /* "MFFCCCC"FFCCCC or "FFCCCC"FFCCCC */ - scan_int(); - if (doclass) { - mcls = (cur_val / 0x1000000); - cur_val = (cur_val & 0xFFFFFF); - } - cur_val1 = cur_val; - scan_int(); - if ((cur_val1 > 0xFFFFFF) || (cur_val > 0xFFFFFF)) { - tex_error("Invalid delimiter code", hlp); - cur_val1 = 0; - cur_val = 0; - } - msfam = (cur_val1 / 0x10000); - mschr = (cur_val1 % 0x10000); - mlfam = (cur_val / 0x10000); - mlchr = (cur_val % 0x10000); } else if (extcode == xetex_mathcode) { /* \.{\\Udelcode} */ /* <0-7>,<0-0xFF>,<0-0x10FFFF> or <0-0xFF>,<0-0x10FFFF> */ if (doclass) { @@ -1172,21 +1147,6 @@ mathcodeval scan_mathchar(int extcode) mcls = (cur_val / 0x1000); mfam = ((cur_val % 0x1000) / 0x100); mchr = (cur_val % 0x100); - } else if (extcode == aleph_mathcode) { /* \.{\\omathcode} */ - /* "TFFCCCC */ - scan_int(); - if (cur_val > 0x8000000) { - tex_error("Invalid math code", hlp); - cur_val = 0; - } - if (cur_val < 0) { - snprintf(errstr, 255, "Bad mathchar (%d)", (int)cur_val); - tex_error(errstr, hlp); - cur_val = 0; - } - mcls = (cur_val / 0x1000000); - mfam = ((cur_val % 0x1000000) / 0x10000); - mchr = (cur_val % 0x10000); } else if (extcode == xetex_mathcode) { /* <0-0x7> <0-0xFF> <0-0x10FFFF> */ scan_int(); @@ -1269,10 +1229,6 @@ mathcodeval mathchar_from_integer(int value, int extcode) mval.class_value = (value / 0x1000); mval.family_value = ((value % 0x1000) / 0x100); mval.character_value = (value % 0x100); - } else if (extcode == aleph_mathcode) { - mval.class_value = (value / 0x1000000); - mval.family_value = ((value % 0x1000000) / 0x10000); - mval.character_value = (value % 0x10000); } else { /* some xetexended xetex thing */ int mfam = (value / 0x200000) & 0x7FF; mval.class_value = mfam % 0x08; @@ -1326,10 +1282,8 @@ int scan_math(pointer p, int mstyle) 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 if (cur_chr == 3) + else if (cur_chr == 2) mval = scan_mathchar(xetexnum_mathcode); else confusion("scan_math"); @@ -1337,9 +1291,6 @@ int scan_math(pointer p, int mstyle) case math_given_cmd: mval = mathchar_from_integer(cur_chr, tex_mathcode); break; - case omath_given_cmd: - mval = mathchar_from_integer(cur_chr, aleph_mathcode); - break; case xmath_given_cmd: mval = mathchar_from_integer(cur_chr, xetex_mathcode); break; @@ -1347,8 +1298,6 @@ int scan_math(pointer p, int mstyle) if (cur_chr == 0) mval = scan_delimiter_as_mathchar(tex_mathcode); else if (cur_chr == 1) - mval = scan_delimiter_as_mathchar(aleph_mathcode); - else if (cur_chr == 2) mval = scan_delimiter_as_mathchar(xetex_mathcode); else confusion("scan_math"); @@ -1489,8 +1438,6 @@ static void scan_delimiter(pointer p, int r) delcodeval dval = { 0, 0, 0, 0, 0, 0 }; if (r == tex_mathcode) { /* \.{\\radical} */ dval = do_scan_extdef_del_code(tex_mathcode, true); - } else if (r == aleph_mathcode) { /* \.{\\oradical} */ - dval = do_scan_extdef_del_code(aleph_mathcode, true); } else if (r == xetex_mathcode) { /* \.{\\Uradical} */ dval = do_scan_extdef_del_code(xetex_mathcode, false); } else if (r == no_mathcode) { @@ -1503,9 +1450,7 @@ static void scan_delimiter(pointer p, int r) case delim_num_cmd: if (cur_chr == 0) /* \.{\\delimiter} */ dval = do_scan_extdef_del_code(tex_mathcode, true); - else if (cur_chr == 1) /* \.{\\odelimiter} */ - dval = do_scan_extdef_del_code(aleph_mathcode, true); - else if (cur_chr == 2) /* \.{\\Udelimiter} */ + else if (cur_chr == 1) /* \.{\\Udelimiter} */ dval = do_scan_extdef_del_code(xetex_mathcode, true); else confusion("scan_delimiter1"); @@ -1554,23 +1499,21 @@ void math_radical(void) left_delimiter(tail) = q; if (chr_code == 0) /* \.{\\radical} */ scan_delimiter(left_delimiter(tail), tex_mathcode); - else if (chr_code == 1) /* \.{\\oradical} */ - scan_delimiter(left_delimiter(tail), aleph_mathcode); - else if (chr_code == 2) /* \.{\\Uradical} */ + else if (chr_code == 1) /* \.{\\Uradical} */ scan_delimiter(left_delimiter(tail), xetex_mathcode); - else if (chr_code == 3) /* \.{\\Uroot} */ + else if (chr_code == 2) /* \.{\\Uroot} */ scan_delimiter(left_delimiter(tail), xetex_mathcode); - else if (chr_code == 4) /* \.{\\Uunderdelimiter} */ + else if (chr_code == 3) /* \.{\\Uunderdelimiter} */ scan_delimiter(left_delimiter(tail), xetex_mathcode); - else if (chr_code == 5) /* \.{\\Uoverdelimiter} */ + else if (chr_code == 4) /* \.{\\Uoverdelimiter} */ scan_delimiter(left_delimiter(tail), xetex_mathcode); - else if (chr_code == 6) /* \.{\\Udelimiterunder} */ + else if (chr_code == 5) /* \.{\\Udelimiterunder} */ scan_delimiter(left_delimiter(tail), xetex_mathcode); - else if (chr_code == 7) /* \.{\\Udelimiterover} */ + else if (chr_code == 6) /* \.{\\Udelimiterover} */ scan_delimiter(left_delimiter(tail), xetex_mathcode); else confusion("math_radical"); - if (chr_code == 3) { + if (chr_code == 2) { /* the trick with the |vlink(q)| is used by |scan_math| to decide whether it needs to go on */ q = new_node(math_char_node, 0); @@ -1606,9 +1549,7 @@ void math_ac(void) tail_append(new_node(accent_noad, 0)); if (cur_chr == 0) { /* \.{\\mathaccent} */ t = scan_mathchar(tex_mathcode); - } else if (cur_chr == 1) { /* \.{\\omathaccent} */ - t = scan_mathchar(aleph_mathcode); - } else if (cur_chr == 2) { /* \.{\\Umathaccent} */ + } else if (cur_chr == 1) { /* \.{\\Umathaccent} */ if (scan_keyword("fixed")) { subtype(tail) = 1; t = scan_mathchar(xetex_mathcode); @@ -1629,13 +1570,6 @@ void math_ac(void) } 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) { /* deprecated: \.{\\Umathaccents} */ - pdftex_warn("\\Umathaccents is deprecated, please update to \\Umathaccent both"); - t = scan_mathchar(xetex_mathcode); - b = scan_mathchar(xetex_mathcode); } else { confusion("math_ac"); } @@ -1868,7 +1802,6 @@ surround an accent that is the nucleus of an Ord atom. @c void close_math_group(pointer p) { - pointer q; int old_style = m_style; unsave_math(); @@ -1899,7 +1832,7 @@ void close_math_group(pointer p) if (saved_value(0) == nucleus(tail)) { if (type(tail) == simple_noad && subtype(tail) == ord_noad_type) { - q = head; + pointer q = head; while (vlink(q) != tail) q = vlink(q); vlink(q) = p; diff --git a/Build/source/texk/web2c/luatexdir/tex/texnodes.h b/Build/source/texk/web2c/luatexdir/tex/texnodes.h index 45c84032fd8..a9b935c8d34 100644 --- a/Build/source/texk/web2c/luatexdir/tex/texnodes.h +++ b/Build/source/texk/web2c/luatexdir/tex/texnodes.h @@ -1,4 +1,4 @@ -/* nodes.h +/* texnodes.h Copyright 2006-2008 Taco Hoekwater <taco@luatex.org> @@ -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 4090 2011-02-28 08:51:20Z taco $ */ +/* $Id: texnodes.h 4445 2012-05-25 23:18:09Z hhenkel $ */ #include <stdarg.h> diff --git a/Build/source/texk/web2c/luatexdir/tex/texnodes.w b/Build/source/texk/web2c/luatexdir/tex/texnodes.w index 3e971013d21..1d7f3a9bfd8 100644 --- a/Build/source/texk/web2c/luatexdir/tex/texnodes.w +++ b/Build/source/texk/web2c/luatexdir/tex/texnodes.w @@ -1,26 +1,26 @@ % texnodes.w - +% % Copyright 2006-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along -% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. +% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c static const char _svn_version[] = - "$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 $"; + "$Id: texnodes.w 4442 2012-05-25 22:40:34Z hhenkel $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/texnodes.w $"; #include "ptexlib.h" #include "lua/luatex-api.h" @@ -2839,7 +2839,6 @@ pointer actual_box_width(pointer r, scaled base_width) scaled w; /* calculated |size| */ pointer p; /* current node when calculating |pre_display_size| */ pointer q; /* glue specification when calculating |pre_display_size| */ - internal_font_number f; /* font in current |char_node| */ scaled d; /* increment to |v| */ scaled v; /* |w| plus possible glue amount */ w = -max_dimen; @@ -2847,7 +2846,6 @@ pointer actual_box_width(pointer r, scaled base_width) p = list_ptr(r); while (p != null) { if (is_char_node(p)) { - f = font(p); d = glyph_width(p); goto found; } diff --git a/Build/source/texk/web2c/luatexdir/tex/textcodes.w b/Build/source/texk/web2c/luatexdir/tex/textcodes.w index fae9ba9ce87..405cfcf993a 100644 --- a/Build/source/texk/web2c/luatexdir/tex/textcodes.w +++ b/Build/source/texk/web2c/luatexdir/tex/textcodes.w @@ -1,28 +1,28 @@ % textcodes.w -% +% % Copyright 2006-2010 Taco Hoekwater <taco@@luatex.org> - +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along -% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. +% with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -#include "ptexlib.h" - static const char _svn_version[] = - "$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 $"; + "$Id: textcodes.w 4519 2012-12-14 09:11:19Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/textcodes.w $"; + +#include "ptexlib.h" @ @c #define LCCODESTACK 8 @@ -139,7 +139,7 @@ static sa_tree *catcode_heads = NULL; static int catcode_max = 0; static unsigned char *catcode_valid = NULL; -#define CATCODE_MAX 65535 +#define CATCODE_MAX 32767 #define update_catcode_max(h) if (h > catcode_max) catcode_max = h diff --git a/Build/source/texk/web2c/luatexdir/tex/textoken.w b/Build/source/texk/web2c/luatexdir/tex/textoken.w index 2a57eff17c5..f087e719788 100644 --- a/Build/source/texk/web2c/luatexdir/tex/textoken.w +++ b/Build/source/texk/web2c/luatexdir/tex/textoken.w @@ -1,26 +1,26 @@ % textoken.w -% -% Copyright 2006-2010 Taco Hoekwater <taco@@luatex.org> - +% +% Copyright 2006-2011 Taco Hoekwater <taco@@luatex.org> +% % This file is part of LuaTeX. - +% % LuaTeX is free software; you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your % option) any later version. - +% % LuaTeX is distributed in the hope that it will be useful, but WITHOUT % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or % FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public % License for more details. - +% % You should have received a copy of the GNU General Public License along % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c static const char _svn_version[] = - "$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 $"; + "$Id: textoken.w 4586 2013-03-01 09:52:21Z taco $" + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/textoken.w $"; #include "ptexlib.h" @@ -36,11 +36,11 @@ static const char _svn_version[] = #define detokenized_line() (line_catcode_table==NO_CAT_TABLE) -#define do_get_cat_code(a) do { \ +#define do_get_cat_code(a,b) do { \ if (line_catcode_table!=DEFAULT_CAT_TABLE) \ - a=get_cat_code(line_catcode_table,cur_chr); \ + a=get_cat_code(line_catcode_table,b); \ else \ - a=get_cat_code(cat_code_table,cur_chr); \ + a=get_cat_code(cat_code_table,b); \ } while (0) @@ -426,10 +426,10 @@ void delete_token_ref(halfword p) } @ @c -int get_char_cat_code(int cur_chr) +int get_char_cat_code(int curchr) { int a; - do_get_cat_code(a); + do_get_cat_code(a,curchr); return a; } @@ -820,7 +820,7 @@ static boolean get_next_file(void) if (detokenized_line()) { cur_cmd = (cur_chr == ' ' ? 10 : 12); } else { - do_get_cat_code(cur_cmd); + do_get_cat_code(cur_cmd, cur_chr); } /* Change state if necessary, and |goto switch| if the current @@ -1096,7 +1096,7 @@ static int scan_control_sequence(void) while (1) { int k = iloc; do_buffer_to_unichar(cur_chr, k); - do_get_cat_code(cat); + do_get_cat_code(cat, cur_chr); if (cat != letter_cmd || k > ilimit) { retval = (cat == spacer_cmd ? skip_blanks : mid_line); if (cat == sup_mark_cmd && check_expanded_code(&k)) /* If an expanded...; */ @@ -1105,7 +1105,7 @@ static int scan_control_sequence(void) retval = skip_blanks; do { do_buffer_to_unichar(cur_chr, k); - do_get_cat_code(cat); + do_get_cat_code(cat, cur_chr); } while (cat == letter_cmd && k <= ilimit); if (cat == sup_mark_cmd && check_expanded_code(&k)) /* If an expanded...; */ @@ -1605,6 +1605,27 @@ void ins_the_toks(void) ins_list(token_link(temp_token_head)); } +@ This routine, used in the next one, prints the job name, possibly +modified by the |process_jobname| callback. + +@c +static void print_job_name(void) +{ + if (job_name) { + char *s, *ss; /* C strings for jobname before and after processing */ + int callback_id, lua_retval; + s = (char*)str_string(job_name); + callback_id = callback_defined(process_jobname_callback); + if (callback_id > 0) { + lua_retval = run_callback(callback_id, "S->S", s, &ss); + if ((lua_retval == true) && (ss != NULL)) + s = ss; + } + tprint(s); + } else { + print(job_name); + } +} @ Here is a routine that print the result of a convert command, using the argument |i|. It returns |false | if it does not know to print @@ -1620,18 +1641,15 @@ static boolean print_convert_string(halfword c, int i) case number_code: print_int(i); break; + case uchar_code: + print(i); + break; case roman_numeral_code: print_roman_int(i); break; case etex_code: tprint(eTeX_version_string); break; - case omega_code: - tprint(Omega_version_string); - break; - case aleph_code: - tprint(Aleph_version_string); - break; case pdftex_revision_code: tprint(pdftex_revision); break; @@ -1654,7 +1672,7 @@ static boolean print_convert_string(halfword c, int i) print(format_name); break; case job_name_code: - print(job_name); + print_job_name(); break; case font_name_code: append_string((unsigned char *) font_name(i), @@ -1665,6 +1683,9 @@ static boolean print_convert_string(halfword c, int i) tprint("pt"); } break; + case font_id_code: + print_int(i); + break; case math_style_code: print_math_style(); break; @@ -1681,17 +1702,11 @@ static boolean print_convert_string(halfword c, int i) tprint("pt"); break; case pdf_page_ref_code: - print_int(get_obj(static_pdf, obj_type_page, i, false)); + print_int(pdf_get_obj(static_pdf, obj_type_page, i, false)); break; case pdf_xform_name_code: print_int(obj_info(static_pdf, i)); break; - case Aleph_revision_code: - tprint(Aleph_revision); - break; - case Omega_revision_code: - tprint(Omega_revision); - break; case eTeX_revision_code: tprint(eTeX_revision); break; @@ -1752,6 +1767,9 @@ void conv_toks(void) str_number str; /* Scan the argument for command |c| */ switch (c) { + case uchar_code: + scan_char_num(); + break; case number_code: case roman_numeral_code: scan_int(); @@ -1764,10 +1782,9 @@ void conv_toks(void) scanner_status = save_scanner_status; break; case etex_code: - case omega_code: - case aleph_code: break; case font_name_code: + case font_id_code: scan_font_ident(); break; case pdftex_revision_code: @@ -1848,7 +1865,7 @@ void conv_toks(void) break; case lua_escape_string_code: { - lstring str; + lstring escstr; int l = 0; save_scanner_status = scanner_status; save_def_ref = def_ref; @@ -1856,16 +1873,16 @@ void conv_toks(void) scan_pdf_ext_toks(); bool = in_lua_escape; in_lua_escape = true; - str.s = (unsigned char *) tokenlist_to_cstring(def_ref, false, &l); - str.l = (unsigned) l; + escstr.s = (unsigned char *) tokenlist_to_cstring(def_ref, false, &l); + escstr.l = (unsigned) l; in_lua_escape = bool; delete_token_ref(def_ref); def_ref = save_def_ref; warning_index = save_warning_index; scanner_status = save_scanner_status; - (void) lua_str_toks(str); + (void) lua_str_toks(escstr); ins_list(token_link(temp_token_head)); - free(str.s); + free(escstr.s); return; } break; @@ -1916,8 +1933,6 @@ void conv_toks(void) pdf_error("pdfximagebbox", "invalid parameter"); break; /* Cases of 'Scan the argument for command |c|' */ - case Aleph_revision_code: - case Omega_revision_code: case eTeX_revision_code: break; default: |