diff options
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/tex')
64 files changed, 185 insertions, 177 deletions
diff --git a/Build/source/texk/web2c/luatexdir/tex/align.h b/Build/source/texk/web2c/luatexdir/tex/align.h index 5afa7a754c8..a93539f0dc5 100644 --- a/Build/source/texk/web2c/luatexdir/tex/align.h +++ b/Build/source/texk/web2c/luatexdir/tex/align.h @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: align.h 3100 2009-11-04 15:09:57Z taco $ */ #ifndef ALIGN_H # define ALIGN_H 1 diff --git a/Build/source/texk/web2c/luatexdir/tex/align.w b/Build/source/texk/web2c/luatexdir/tex/align.w index 1e5c48cc0c4..adc30a46007 100644 --- a/Build/source/texk/web2c/luatexdir/tex/align.w +++ b/Build/source/texk/web2c/luatexdir/tex/align.w @@ -20,9 +20,7 @@ \def\<#1>{$#1$} @ @c -static const char _svn_version[] = - "$Id: align.w 5081 2014-11-07 18:38:33Z luigi $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/align.w $"; + #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/arithmetic.h b/Build/source/texk/web2c/luatexdir/tex/arithmetic.h index 6e809372ab6..e5638990e0c 100644 --- a/Build/source/texk/web2c/luatexdir/tex/arithmetic.h +++ b/Build/source/texk/web2c/luatexdir/tex/arithmetic.h @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: arithmetic.h 3853 2010-09-03 18:05:14Z oneiros $ */ #ifndef ARITHMETIC_H # define ARITHMETIC_H diff --git a/Build/source/texk/web2c/luatexdir/tex/arithmetic.w b/Build/source/texk/web2c/luatexdir/tex/arithmetic.w index 5606aa641ec..56fb9568acb 100644 --- a/Build/source/texk/web2c/luatexdir/tex/arithmetic.w +++ b/Build/source/texk/web2c/luatexdir/tex/arithmetic.w @@ -20,9 +20,7 @@ \def\MP{MetaPost} @ @c -static const char _svn_version[] = - "$Id: arithmetic.w 4593 2013-03-19 14:25:17Z taco $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/arithmetic.w $"; + #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/buildpage.h b/Build/source/texk/web2c/luatexdir/tex/buildpage.h index f3e8f46abbc..9c013514efa 100644 --- a/Build/source/texk/web2c/luatexdir/tex/buildpage.h +++ b/Build/source/texk/web2c/luatexdir/tex/buildpage.h @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: buildpage.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef BUILDPAGE_H # define BUILDPAGE_H diff --git a/Build/source/texk/web2c/luatexdir/tex/buildpage.w b/Build/source/texk/web2c/luatexdir/tex/buildpage.w index 5e96e701c71..68cb3fecc5a 100644 --- a/Build/source/texk/web2c/luatexdir/tex/buildpage.w +++ b/Build/source/texk/web2c/luatexdir/tex/buildpage.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: buildpage.w 4956 2014-03-28 12:12:17Z luigi $" - "$URL: https://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 690823b7856..52857215b51 100644 --- a/Build/source/texk/web2c/luatexdir/tex/commands.h +++ b/Build/source/texk/web2c/luatexdir/tex/commands.h @@ -17,7 +17,6 @@ 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 4877 2014-03-14 01:26:05Z luigi $ */ #ifndef COMMANDS_H # define COMMANDS_H diff --git a/Build/source/texk/web2c/luatexdir/tex/commands.w b/Build/source/texk/web2c/luatexdir/tex/commands.w index 51d2112c1d5..1ba433884b0 100644 --- a/Build/source/texk/web2c/luatexdir/tex/commands.w +++ b/Build/source/texk/web2c/luatexdir/tex/commands.w @@ -20,9 +20,7 @@ \def\eTeX{e-\TeX} @ @c -static const char _svn_version[] = - "$Id: commands.w 4878 2014-03-14 10:48:03Z taco $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/commands.w $"; + #include "ptexlib.h" @@ -1060,6 +1058,8 @@ void initialize_etex_commands(void) int_base + suppress_fontnotfound_error_code, int_base); primitive_luatex("suppresslongerror", assign_int_cmd, int_base + suppress_long_error_code, int_base); + primitive_luatex("suppressmathparerror", assign_int_cmd, + int_base + suppress_mathpar_error_code, int_base); primitive_luatex("suppressifcsnameerror", assign_int_cmd, int_base + suppress_ifcsname_error_code, int_base); primitive_luatex("suppressoutererror", assign_int_cmd, diff --git a/Build/source/texk/web2c/luatexdir/tex/conditional.h b/Build/source/texk/web2c/luatexdir/tex/conditional.h index 23c79a03d3a..13e822a1bf9 100644 --- a/Build/source/texk/web2c/luatexdir/tex/conditional.h +++ b/Build/source/texk/web2c/luatexdir/tex/conditional.h @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: conditional.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef CONDITIONAL_H # define CONDITIONAL_H diff --git a/Build/source/texk/web2c/luatexdir/tex/conditional.w b/Build/source/texk/web2c/luatexdir/tex/conditional.w index 16092a491da..8c312a536c8 100644 --- a/Build/source/texk/web2c/luatexdir/tex/conditional.w +++ b/Build/source/texk/web2c/luatexdir/tex/conditional.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: conditional.w 4442 2012-05-25 22:40:34Z hhenkel $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/conditional.w $"; + #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/directions.h b/Build/source/texk/web2c/luatexdir/tex/directions.h index 30f52743388..b595032f48e 100644 --- a/Build/source/texk/web2c/luatexdir/tex/directions.h +++ b/Build/source/texk/web2c/luatexdir/tex/directions.h @@ -17,7 +17,6 @@ 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 4569 2013-01-30 10:08:33Z taco $ */ #ifndef DIRECTIONS_H # define DIRECTIONS_H diff --git a/Build/source/texk/web2c/luatexdir/tex/directions.w b/Build/source/texk/web2c/luatexdir/tex/directions.w index 704f8ff2508..54f5586bc6b 100644 --- a/Build/source/texk/web2c/luatexdir/tex/directions.w +++ b/Build/source/texk/web2c/luatexdir/tex/directions.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: directions.w 4956 2014-03-28 12:12:17Z luigi $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/directions.w $"; + #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/dumpdata.h b/Build/source/texk/web2c/luatexdir/tex/dumpdata.h index 349e37fb238..933dcfa1f0d 100644 --- a/Build/source/texk/web2c/luatexdir/tex/dumpdata.h +++ b/Build/source/texk/web2c/luatexdir/tex/dumpdata.h @@ -17,7 +17,6 @@ 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 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 46913bce3a8..674a7cd7ae4 100644 --- a/Build/source/texk/web2c/luatexdir/tex/dumpdata.w +++ b/Build/source/texk/web2c/luatexdir/tex/dumpdata.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: dumpdata.w 5081 2014-11-07 18:38:33Z luigi $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/dumpdata.w $"; + #include "ptexlib.h" @@ -28,8 +26,8 @@ static const char _svn_version[] = #define prev_depth cur_list.prev_depth_field /* 907 = sum of the values of the bytes of "don knuth" */ -/* The next FORMAT_ID will be 907+1 */ -#define FORMAT_ID (907+0) +/* The next FORMAT_ID will be 907+2 */ +#define FORMAT_ID (907+1) #if ((FORMAT_ID>=0) && (FORMAT_ID<=256)) #error Wrong value for FORMAT_ID. #endif diff --git a/Build/source/texk/web2c/luatexdir/tex/equivalents.h b/Build/source/texk/web2c/luatexdir/tex/equivalents.h index c0616d91ad5..bb0cbad873e 100644 --- a/Build/source/texk/web2c/luatexdir/tex/equivalents.h +++ b/Build/source/texk/web2c/luatexdir/tex/equivalents.h @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: equivalents.h 3853 2010-09-03 18:05:14Z oneiros $ */ #ifndef EQUIVALENTS_H # define EQUIVALENTS_H @@ -326,7 +325,8 @@ here, and the |number_regs| \.{\\dimen} registers. # define suppress_ifcsname_error_code (etex_first_integer_code+11) /*suppress errors for failed \.{\\ifcsname} */ # define suppress_outer_error_code (etex_first_integer_code+12) /*suppress errors for \.{\\outer} */ -# define synctex_code (etex_first_integer_code+13) /* is synctex file generation enabled ? */ +# define suppress_mathpar_error_code (etex_first_integer_code+13) /*suppress errors for \.{\\par}} in math */ +# define synctex_code (etex_first_integer_code+14) /* is synctex file generation enabled ? */ # define tex_int_pars (synctex_code+1) /* total number of integer parameters */ # define page_direction_code (tex_int_pars) diff --git a/Build/source/texk/web2c/luatexdir/tex/equivalents.w b/Build/source/texk/web2c/luatexdir/tex/equivalents.w index 3c948634f98..5fe8b4ec500 100644 --- a/Build/source/texk/web2c/luatexdir/tex/equivalents.w +++ b/Build/source/texk/web2c/luatexdir/tex/equivalents.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: equivalents.w 4442 2012-05-25 22:40:34Z hhenkel $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/equivalents.w $"; + #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/errors.h b/Build/source/texk/web2c/luatexdir/tex/errors.h index 537bea562da..b7f46431e5d 100644 --- a/Build/source/texk/web2c/luatexdir/tex/errors.h +++ b/Build/source/texk/web2c/luatexdir/tex/errors.h @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: errors.h 5081 2014-11-07 18:38:33Z luigi $ */ #ifndef ERRORS_H # define ERRORS_H diff --git a/Build/source/texk/web2c/luatexdir/tex/errors.w b/Build/source/texk/web2c/luatexdir/tex/errors.w index eab33d9c809..dd32f5b7a28 100644 --- a/Build/source/texk/web2c/luatexdir/tex/errors.w +++ b/Build/source/texk/web2c/luatexdir/tex/errors.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: errors.w 5081 2014-11-07 18:38:33Z luigi $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/errors.w $"; + #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/expand.h b/Build/source/texk/web2c/luatexdir/tex/expand.h index ce1af9f552a..713901986a3 100644 --- a/Build/source/texk/web2c/luatexdir/tex/expand.h +++ b/Build/source/texk/web2c/luatexdir/tex/expand.h @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: expand.h 2728 2009-07-04 11:33:51Z oneiros $ */ #ifndef EXPAND_H # define EXPAND_H diff --git a/Build/source/texk/web2c/luatexdir/tex/expand.w b/Build/source/texk/web2c/luatexdir/tex/expand.w index d00d84e128d..aad2cb10042 100644 --- a/Build/source/texk/web2c/luatexdir/tex/expand.w +++ b/Build/source/texk/web2c/luatexdir/tex/expand.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: expand.w 4442 2012-05-25 22:40:34Z hhenkel $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/expand.w $"; + #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/extensions.h b/Build/source/texk/web2c/luatexdir/tex/extensions.h index 590dec0e6bd..ad6dd784861 100644 --- a/Build/source/texk/web2c/luatexdir/tex/extensions.h +++ b/Build/source/texk/web2c/luatexdir/tex/extensions.h @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: extensions.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef EXTENSIONS_H # define EXTENSIONS_H diff --git a/Build/source/texk/web2c/luatexdir/tex/extensions.w b/Build/source/texk/web2c/luatexdir/tex/extensions.w index 41f709d3e29..c0345d3c089 100644 --- a/Build/source/texk/web2c/luatexdir/tex/extensions.w +++ b/Build/source/texk/web2c/luatexdir/tex/extensions.w @@ -21,9 +21,7 @@ \def\pdfTeX{pdf\TeX} @ @c -static const char _svn_version[] = - "$Id: extensions.w 4519 2012-12-14 09:11:19Z taco $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/extensions.w $"; + #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/filename.h b/Build/source/texk/web2c/luatexdir/tex/filename.h index d0e54283436..cb3d060fd83 100644 --- a/Build/source/texk/web2c/luatexdir/tex/filename.h +++ b/Build/source/texk/web2c/luatexdir/tex/filename.h @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: filename.h 3376 2010-01-25 16:50:23Z taco $ */ #ifndef FILENAME_H # define FILENAME_H diff --git a/Build/source/texk/web2c/luatexdir/tex/filename.w b/Build/source/texk/web2c/luatexdir/tex/filename.w index 95a94a75074..db0ea298d30 100644 --- a/Build/source/texk/web2c/luatexdir/tex/filename.w +++ b/Build/source/texk/web2c/luatexdir/tex/filename.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: filename.w 5081 2014-11-07 18:38:33Z luigi $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/filename.w $"; + #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/inputstack.h b/Build/source/texk/web2c/luatexdir/tex/inputstack.h index 246bc93e9e2..390fb169198 100644 --- a/Build/source/texk/web2c/luatexdir/tex/inputstack.h +++ b/Build/source/texk/web2c/luatexdir/tex/inputstack.h @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: inputstack.h 3853 2010-09-03 18:05:14Z oneiros $ */ #ifndef INPUTSTACK_H # define INPUTSTACK_H 1 diff --git a/Build/source/texk/web2c/luatexdir/tex/inputstack.w b/Build/source/texk/web2c/luatexdir/tex/inputstack.w index 2fc5628e251..129f2207650 100644 --- a/Build/source/texk/web2c/luatexdir/tex/inputstack.w +++ b/Build/source/texk/web2c/luatexdir/tex/inputstack.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: inputstack.w 4442 2012-05-25 22:40:34Z hhenkel $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/inputstack.w $"; + #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/linebreak.h b/Build/source/texk/web2c/luatexdir/tex/linebreak.h index e91b3f2fa27..4593cc59a4a 100644 --- a/Build/source/texk/web2c/luatexdir/tex/linebreak.h +++ b/Build/source/texk/web2c/luatexdir/tex/linebreak.h @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: linebreak.h 3853 2010-09-03 18:05:14Z oneiros $ */ #ifndef LINEBREAK_H # define LINEBREAK_H diff --git a/Build/source/texk/web2c/luatexdir/tex/linebreak.w b/Build/source/texk/web2c/luatexdir/tex/linebreak.w index fd486c3367e..d49b6f0d0a8 100644 --- a/Build/source/texk/web2c/luatexdir/tex/linebreak.w +++ b/Build/source/texk/web2c/luatexdir/tex/linebreak.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: linebreak.w 4777 2014-02-10 10:09:39Z luigi $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/linebreak.w $"; + #include "ptexlib.h" @@ -1951,8 +1949,11 @@ ext_do_line_break(int paragraph_dir, /* Try to break after a discretionary fragment, then |goto done5|; */ /* The following code knows that discretionary texts contain only character nodes, kern nodes, box nodes, and rule - nodes. */ - if (second_pass) { + nodes. This branch differs a bit from older engines because in LuaTeX we + already have hyphenated the list. This means that we need to skip + automatic disc nodes. Of better, we need to treat discretionaries + and explicit hyphens always, even in the first pass (HH). */ + if (second_pass || subtype(cur_p) <= automatic_disc) { int actual_penalty = hyphen_penalty; if (subtype(cur_p) == automatic_disc) actual_penalty = ex_hyphen_penalty; diff --git a/Build/source/texk/web2c/luatexdir/tex/mainbody.h b/Build/source/texk/web2c/luatexdir/tex/mainbody.h index 789ef80ad99..1cbd214e016 100644 --- a/Build/source/texk/web2c/luatexdir/tex/mainbody.h +++ b/Build/source/texk/web2c/luatexdir/tex/mainbody.h @@ -17,7 +17,6 @@ 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 4462 2012-08-07 15:08:21Z taco $ */ #ifndef MAINBODY_H # define MAINBODY_H diff --git a/Build/source/texk/web2c/luatexdir/tex/mainbody.w b/Build/source/texk/web2c/luatexdir/tex/mainbody.w index 4fe5f20c30b..56191cbe25e 100644 --- a/Build/source/texk/web2c/luatexdir/tex/mainbody.w +++ b/Build/source/texk/web2c/luatexdir/tex/mainbody.w @@ -22,9 +22,7 @@ \def\pdfTeX{pdf\TeX} @ @c -static const char _svn_version[] = - "$Id: mainbody.w 4956 2014-03-28 12:12:17Z luigi $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/mainbody.w $"; + #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/maincontrol.h b/Build/source/texk/web2c/luatexdir/tex/maincontrol.h index 681a69c96e3..192b83e1c36 100644 --- a/Build/source/texk/web2c/luatexdir/tex/maincontrol.h +++ b/Build/source/texk/web2c/luatexdir/tex/maincontrol.h @@ -17,7 +17,6 @@ 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 4562 2013-01-21 02:58:59Z khaled $ */ #ifndef MAINCONTROL_H # define MAINCONTROL_H @@ -117,6 +116,7 @@ extern void adjust_space_factor(void); extern void main_control(void); extern void app_space(void); extern void insert_dollar_sign(void); +extern void insert_dollar_sign_par_end(void); extern void you_cant(void); extern void report_illegal_case(void); extern boolean privileged(void); diff --git a/Build/source/texk/web2c/luatexdir/tex/maincontrol.w b/Build/source/texk/web2c/luatexdir/tex/maincontrol.w index 05b842217a5..fa74ffb2a01 100644 --- a/Build/source/texk/web2c/luatexdir/tex/maincontrol.w +++ b/Build/source/texk/web2c/luatexdir/tex/maincontrol.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: maincontrol.w 5011 2014-05-26 08:05:55Z khaled $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/maincontrol.w $"; + #include "ptexlib.h" #include "lua/luatex-api.h" @@ -703,7 +701,7 @@ static void init_main_control (void) { non_math(mskip_cmd, insert_dollar_sign); non_math(math_accent_cmd, insert_dollar_sign); jump_table[mmode + endv_cmd] = insert_dollar_sign; - jump_table[mmode + par_end_cmd] = insert_dollar_sign; + jump_table[mmode + par_end_cmd] = insert_dollar_sign_par_end; jump_table[mmode + stop_cmd] = insert_dollar_sign; jump_table[mmode + vskip_cmd] = insert_dollar_sign; jump_table[mmode + un_vbox_cmd] = insert_dollar_sign; @@ -930,6 +928,19 @@ void insert_dollar_sign(void) ins_error(); } +@ We can silently ignore \.{\\par}s in a math formula. + +@c +void insert_dollar_sign_par_end(void) +{ + if (!int_par(suppress_mathpar_error_code)) { + insert_dollar_sign() ; + } +} + + + + @ The `|you_cant|' procedure prints a line saying that the current command is illegal in the current mode; it identifies these things symbolically. diff --git a/Build/source/texk/web2c/luatexdir/tex/mathcodes.h b/Build/source/texk/web2c/luatexdir/tex/mathcodes.h index 6e428775a3c..1640d82b989 100644 --- a/Build/source/texk/web2c/luatexdir/tex/mathcodes.h +++ b/Build/source/texk/web2c/luatexdir/tex/mathcodes.h @@ -17,7 +17,6 @@ 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 4562 2013-01-21 02:58:59Z khaled $ */ #ifndef MATHCODES_H # define MATHCODES_H diff --git a/Build/source/texk/web2c/luatexdir/tex/mathcodes.w b/Build/source/texk/web2c/luatexdir/tex/mathcodes.w index 7092dace012..b5addc7d6c9 100644 --- a/Build/source/texk/web2c/luatexdir/tex/mathcodes.w +++ b/Build/source/texk/web2c/luatexdir/tex/mathcodes.w @@ -19,9 +19,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: mathcodes.w 4562 2013-01-21 02:58:59Z khaled $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/mathcodes.w $"; + #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/memoryword.h b/Build/source/texk/web2c/luatexdir/tex/memoryword.h index 6f9cfa393b1..5db2bb8cb36 100644 --- a/Build/source/texk/web2c/luatexdir/tex/memoryword.h +++ b/Build/source/texk/web2c/luatexdir/tex/memoryword.h @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: memoryword.h 5031 2014-07-04 07:16:27Z luigi $ */ /* This header file is extra special because it is read in from within the pascal source */ diff --git a/Build/source/texk/web2c/luatexdir/tex/memoryword.w b/Build/source/texk/web2c/luatexdir/tex/memoryword.w index d3002f1b2b6..b596abb37ec 100644 --- a/Build/source/texk/web2c/luatexdir/tex/memoryword.w +++ b/Build/source/texk/web2c/luatexdir/tex/memoryword.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: memoryword.w 4442 2012-05-25 22:40:34Z hhenkel $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/memoryword.w $"; + #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/mlist.h b/Build/source/texk/web2c/luatexdir/tex/mlist.h index c3c8a08b1be..487282ca0c7 100644 --- a/Build/source/texk/web2c/luatexdir/tex/mlist.h +++ b/Build/source/texk/web2c/luatexdir/tex/mlist.h @@ -18,7 +18,6 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: mlist.h 3265 2009-12-18 16:21:40Z taco $ */ #ifndef MLIST_H # define MLIST_H 1 diff --git a/Build/source/texk/web2c/luatexdir/tex/mlist.w b/Build/source/texk/web2c/luatexdir/tex/mlist.w index 427a6348b2d..5de4dbec1b9 100644 --- a/Build/source/texk/web2c/luatexdir/tex/mlist.w +++ b/Build/source/texk/web2c/luatexdir/tex/mlist.w @@ -23,9 +23,7 @@ \def\LuaTeX{Lua\TeX} @ @c -static const char _svn_version[] = - "$Id: mlist.w 5125 2015-01-15 18:36:42Z luigi $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/mlist.w $"; + #include "ptexlib.h" #include "lua/luatex-api.h" @@ -2748,14 +2746,64 @@ will be horizontally shifted over |delta1|, the subscript over |delta2|. We set |shift_down| and |shift_up| to the minimum amounts to shift the baseline of subscripts and superscripts based on the given nucleus. -@c +Note: We need to look at a character but also at the first one in a sub list +and there we ignore leading kerns and glue. Elsewhere is code that removes +kerns assuming that is italic correction. The heuristics are unreliable for +the new fonts so eventualy there will be an option to ignore such corrections. + +@ @c +#define analyze_script(init,su_n,su_f,su_c) do { \ + su_n = init; \ + if (su_n != null) { \ + if (type(su_n) == sub_mlist_node) { \ + su_n = math_list(su_n); \ + if (su_n != null) { \ + while (su_n) { \ + if ((type(su_n) == kern_node) || (type(su_n) == glue_node)) {\ + su_n = vlink(su_n); \ + } else if (type(su_n) == simple_noad) { \ + su_n = nucleus(su_n); \ + if (type(su_n) != math_char_node) { \ + su_n = null; \ + } \ + break; \ + } else { \ + su_n = null; \ + break; \ + } \ + } \ + } \ + } \ + if (su_n != null) { \ + fetch(su_n); \ + if (char_exists(cur_f, cur_c)) { \ + su_f = cur_f; \ + su_c = cur_c; \ + } else { \ + su_n = null; \ + } \ + } \ + } \ + } while (0) + + static void make_scripts(pointer q, pointer p, scaled it, int cur_style) { pointer x, y, z; /* temporary registers for box construction */ scaled shift_up, shift_down, clr; /* dimensions in the calculation */ scaled delta1, delta2; + halfword sub_n, sup_n; + internal_font_number sub_f, sup_f; + int sub_c, sup_c; + sub_n = null; + sup_n = null; + sub_f = 0; + sup_f = 0; + sub_c = 0; + sup_c = 0; delta1 = it; delta2 = 0; + #ifdef DEBUG printf("it: %d\n", it); dump_simple_node(q); @@ -2782,7 +2830,16 @@ static void make_scripts(pointer q, pointer p, scaled it, int cur_style) list_ptr(z) = null; flush_node(z); } + + if (is_char_node(p)) { + /* we look at the subscript character (_i) or first character in a list (_{ij}) */ + analyze_script(subscr(q),sub_n,sub_f,sub_c); + /* we look at the superscript character (^i) or first character in a list (^{ij}) */ + analyze_script(supscr(q),sup_n,sup_f,sup_c); + } + if (supscr(q) == null) { + /* Construct a subscript box |x| when there is no superscript */ /* When there is a subscript without a superscript, the top of the subscript should not exceed the baseline plus four-fifths of the x-height. */ @@ -2796,16 +2853,10 @@ static void make_scripts(pointer q, pointer p, scaled it, int cur_style) shift_amount(x) = shift_down; /* now find and correct for horizontal shift */ - if (is_char_node(p) && subscr(q) != null - && type(subscr(q)) == math_char_node) { - fetch(subscr(q)); - if (char_exists(cur_f, cur_c)) { - delta2 = - find_math_kern(font(p), character(p), cur_f, cur_c, - sub_mark_cmd, shift_down); - if (delta2 != MATH_KERN_NOT_FOUND && delta2 != 0) { - p = attach_hkern_to_new_hlist(q, delta2); - } + if (sub_n != null) { + delta2 = find_math_kern(font(p), character(p),sub_f,sub_c,sub_mark_cmd, shift_down); + if (delta2 != MATH_KERN_NOT_FOUND && delta2 != 0) { + p = attach_hkern_to_new_hlist(q, delta2); } } @@ -2825,15 +2876,10 @@ static void make_scripts(pointer q, pointer p, scaled it, int cur_style) if (subscr(q) == null) { shift_amount(x) = -shift_up; /* now find and correct for horizontal shift */ - if (is_char_node(p) && type(supscr(q)) == math_char_node) { - fetch(supscr(q)); - if (char_exists(cur_f, cur_c)) { - clr = - find_math_kern(font(p), character(p), cur_f, cur_c, - sup_mark_cmd, shift_up); - if (clr != MATH_KERN_NOT_FOUND && clr != 0) { - p = attach_hkern_to_new_hlist(q, clr); - } + if (sup_n != null) { + clr = find_math_kern(font(p),character(p),sup_f,sup_c,sup_mark_cmd,shift_up); + if (clr != MATH_KERN_NOT_FOUND && clr != 0) { + p = attach_hkern_to_new_hlist(q, clr); } } } else { @@ -2849,8 +2895,7 @@ static void make_scripts(pointer q, pointer p, scaled it, int cur_style) width(y) = width(y) + space_after_script(cur_style); if (shift_down < sub_sup_shift_down(cur_style)) shift_down = sub_sup_shift_down(cur_style); - clr = subsup_vgap(cur_style) - - ((shift_up - depth(x)) - (height(y) - shift_down)); + clr = subsup_vgap(cur_style) - ((shift_up - depth(x)) - (height(y) - shift_down)); if (clr > 0) { shift_down = shift_down + clr; clr = sup_sub_bottom_max(cur_style) - (shift_up - depth(x)); @@ -2860,30 +2905,19 @@ static void make_scripts(pointer q, pointer p, scaled it, int cur_style) } } /* now find and correct for horizontal shift */ - if (is_char_node(p) && subscr(q) != null - && type(subscr(q)) == math_char_node) { - fetch(subscr(q)); - if (char_exists(cur_f, cur_c)) { - delta2 = - find_math_kern(font(p), character(p), cur_f, cur_c, - sub_mark_cmd, shift_down); - if (delta2 != MATH_KERN_NOT_FOUND && delta2 != 0) { - p = attach_hkern_to_new_hlist(q, delta2); - } + if (sub_n != null) { + delta2 = find_math_kern(font(p), character(p),sub_f,sub_c,sub_mark_cmd, shift_down); + if (delta2 != MATH_KERN_NOT_FOUND && delta2 != 0) { + p = attach_hkern_to_new_hlist(q, delta2); } } /* now the horizontal shift for the superscript. */ /* the superscript is also to be shifted by |delta1| (the italic correction) */ clr = MATH_KERN_NOT_FOUND; - if (is_char_node(p) && supscr(q) != null - && type(supscr(q)) == math_char_node) { - fetch(supscr(q)); - if (char_exists(cur_f, cur_c)) { - clr = - find_math_kern(font(p), character(p), cur_f, cur_c, - sup_mark_cmd, shift_up); - } + if (sup_n != null) { + clr = find_math_kern(font(p),character(p),sup_f,sup_c,sup_mark_cmd,shift_up); } + if (delta2 == MATH_KERN_NOT_FOUND) delta2 = 0; if (clr != MATH_KERN_NOT_FOUND) { diff --git a/Build/source/texk/web2c/luatexdir/tex/nesting.h b/Build/source/texk/web2c/luatexdir/tex/nesting.h index c46875ad8c6..238522a77d1 100644 --- a/Build/source/texk/web2c/luatexdir/tex/nesting.h +++ b/Build/source/texk/web2c/luatexdir/tex/nesting.h @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: nesting.h 3477 2010-03-12 13:59:34Z taco $ */ #ifndef NESTING_H # define NESTING_H diff --git a/Build/source/texk/web2c/luatexdir/tex/nesting.w b/Build/source/texk/web2c/luatexdir/tex/nesting.w index 177901166f4..ed27600bd5f 100644 --- a/Build/source/texk/web2c/luatexdir/tex/nesting.w +++ b/Build/source/texk/web2c/luatexdir/tex/nesting.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: nesting.w 4442 2012-05-25 22:40:34Z hhenkel $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/nesting.w $"; + #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/packaging.h b/Build/source/texk/web2c/luatexdir/tex/packaging.h index 6e57ed57459..b1e68e8f732 100644 --- a/Build/source/texk/web2c/luatexdir/tex/packaging.h +++ b/Build/source/texk/web2c/luatexdir/tex/packaging.h @@ -17,7 +17,6 @@ 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 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 42a87f1ee0d..edc22b3e824 100644 --- a/Build/source/texk/web2c/luatexdir/tex/packaging.w +++ b/Build/source/texk/web2c/luatexdir/tex/packaging.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: packaging.w 5023 2014-06-18 08:22:44Z taco $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/packaging.w $"; + #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/postlinebreak.h b/Build/source/texk/web2c/luatexdir/tex/postlinebreak.h index fb0e4d9ca6d..e4a492a8ca5 100644 --- a/Build/source/texk/web2c/luatexdir/tex/postlinebreak.h +++ b/Build/source/texk/web2c/luatexdir/tex/postlinebreak.h @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: postlinebreak.h 3493 2010-03-15 11:49:49Z taco $ */ #ifndef POSTLINEBREAK_H # define POSTLINEBREAK_H diff --git a/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w b/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w index d7990ca52c0..2fa1b269fc9 100644 --- a/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w +++ b/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: postlinebreak.w 5081 2014-11-07 18:38:33Z luigi $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/postlinebreak.w $"; + #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/primitive.h b/Build/source/texk/web2c/luatexdir/tex/primitive.h index b00a6b770ed..cca6fe9de08 100644 --- a/Build/source/texk/web2c/luatexdir/tex/primitive.h +++ b/Build/source/texk/web2c/luatexdir/tex/primitive.h @@ -17,7 +17,6 @@ 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 4564 2013-01-21 13:25:53Z khaled $ */ #ifndef LUATEX_PRIMITIVE_H # define LUATEX_PRIMITIVE_H 1 diff --git a/Build/source/texk/web2c/luatexdir/tex/primitive.w b/Build/source/texk/web2c/luatexdir/tex/primitive.w index e02ae1a7735..e343a0ffd07 100644 --- a/Build/source/texk/web2c/luatexdir/tex/primitive.w +++ b/Build/source/texk/web2c/luatexdir/tex/primitive.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: primitive.w 4562 2013-01-21 02:58:59Z khaled $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/primitive.w $"; + #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/printing.h b/Build/source/texk/web2c/luatexdir/tex/printing.h index 057ed422b95..04109cdf8a4 100644 --- a/Build/source/texk/web2c/luatexdir/tex/printing.h +++ b/Build/source/texk/web2c/luatexdir/tex/printing.h @@ -17,7 +17,6 @@ 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 5002 2014-05-20 09:14:16Z taco $ */ #ifndef PRINTING_H # define PRINTING_H diff --git a/Build/source/texk/web2c/luatexdir/tex/printing.w b/Build/source/texk/web2c/luatexdir/tex/printing.w index ce64d1e829c..0cc4185823a 100644 --- a/Build/source/texk/web2c/luatexdir/tex/printing.w +++ b/Build/source/texk/web2c/luatexdir/tex/printing.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: printing.w 5081 2014-11-07 18:38:33Z luigi $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/printing.w $"; + #include "ptexlib.h" #include "lua/luatex-api.h" /* for ptexbanner */ diff --git a/Build/source/texk/web2c/luatexdir/tex/scanning.h b/Build/source/texk/web2c/luatexdir/tex/scanning.h index ca7804ea749..6c858a2c25e 100644 --- a/Build/source/texk/web2c/luatexdir/tex/scanning.h +++ b/Build/source/texk/web2c/luatexdir/tex/scanning.h @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: scanning.h 4877 2014-03-14 01:26:05Z luigi $ */ #ifndef SCANNING_H # define SCANNING_H diff --git a/Build/source/texk/web2c/luatexdir/tex/scanning.w b/Build/source/texk/web2c/luatexdir/tex/scanning.w index 7e2283a92cc..337c19a8276 100644 --- a/Build/source/texk/web2c/luatexdir/tex/scanning.w +++ b/Build/source/texk/web2c/luatexdir/tex/scanning.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: scanning.w 5009 2014-05-26 07:49:59Z taco $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/scanning.w $"; + #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/stringpool.h b/Build/source/texk/web2c/luatexdir/tex/stringpool.h index d9a33fe102d..a969547e763 100644 --- a/Build/source/texk/web2c/luatexdir/tex/stringpool.h +++ b/Build/source/texk/web2c/luatexdir/tex/stringpool.h @@ -17,7 +17,6 @@ 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 4599 2013-03-19 15:41:07Z taco $ */ #ifndef STRINGPOOL_H # define STRINGPOOL_H diff --git a/Build/source/texk/web2c/luatexdir/tex/stringpool.w b/Build/source/texk/web2c/luatexdir/tex/stringpool.w index 990c619d7f2..5972657f56e 100644 --- a/Build/source/texk/web2c/luatexdir/tex/stringpool.w +++ b/Build/source/texk/web2c/luatexdir/tex/stringpool.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: stringpool.w 4599 2013-03-19 15:41:07Z taco $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/stringpool.w $"; + #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/texdeffont.h b/Build/source/texk/web2c/luatexdir/tex/texdeffont.h index e2ce6f91cc0..24782f5fbe4 100644 --- a/Build/source/texk/web2c/luatexdir/tex/texdeffont.h +++ b/Build/source/texk/web2c/luatexdir/tex/texdeffont.h @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: texdeffont.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef TEXDEFFONT_H # define TEXDEFFONT_H diff --git a/Build/source/texk/web2c/luatexdir/tex/texdeffont.w b/Build/source/texk/web2c/luatexdir/tex/texdeffont.w index 174a1ba86dc..7fe5ae1e18c 100644 --- a/Build/source/texk/web2c/luatexdir/tex/texdeffont.w +++ b/Build/source/texk/web2c/luatexdir/tex/texdeffont.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: texdeffont.w 4520 2012-12-14 09:15:55Z taco $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/texdeffont.w $"; + #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/texfileio.h b/Build/source/texk/web2c/luatexdir/tex/texfileio.h index d0f5c45e5c4..c6366500766 100644 --- a/Build/source/texk/web2c/luatexdir/tex/texfileio.h +++ b/Build/source/texk/web2c/luatexdir/tex/texfileio.h @@ -17,7 +17,6 @@ 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 4521 2012-12-14 13:54:54Z taco $ */ #ifndef TEXFILEIO_H # define TEXFILEIO_H diff --git a/Build/source/texk/web2c/luatexdir/tex/texfileio.w b/Build/source/texk/web2c/luatexdir/tex/texfileio.w index f6314e3f181..4d50504386c 100644 --- a/Build/source/texk/web2c/luatexdir/tex/texfileio.w +++ b/Build/source/texk/web2c/luatexdir/tex/texfileio.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: texfileio.w 4956 2014-03-28 12:12:17Z luigi $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/texfileio.w $"; + #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/texmath.h b/Build/source/texk/web2c/luatexdir/tex/texmath.h index 75a595e545f..72b83de6143 100644 --- a/Build/source/texk/web2c/luatexdir/tex/texmath.h +++ b/Build/source/texk/web2c/luatexdir/tex/texmath.h @@ -18,7 +18,6 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: texmath.h 3461 2010-03-09 10:20:54Z taco $ */ #ifndef TEXMATH_H # define TEXMATH_H 1 diff --git a/Build/source/texk/web2c/luatexdir/tex/texmath.w b/Build/source/texk/web2c/luatexdir/tex/texmath.w index 428e5001304..f7280b72f37 100644 --- a/Build/source/texk/web2c/luatexdir/tex/texmath.w +++ b/Build/source/texk/web2c/luatexdir/tex/texmath.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: texmath.w 5081 2014-11-07 18:38:33Z luigi $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/texmath.w $"; + #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/texnodes.h b/Build/source/texk/web2c/luatexdir/tex/texnodes.h index d1015373909..97ad3b0ede9 100644 --- a/Build/source/texk/web2c/luatexdir/tex/texnodes.h +++ b/Build/source/texk/web2c/luatexdir/tex/texnodes.h @@ -17,7 +17,6 @@ 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 4847 2014-03-05 18:13:17Z luigi $ */ #include <stdarg.h> @@ -90,8 +89,10 @@ extern void undump_node_mem(void); # define attribute_node_size 2 + # define attr_list_ref(a) vinfo((a)+1) /* the reference count */ +# define assign_attribute_ref(n,p) do { node_attr(n) = p;attr_list_ref(p)++;} while (0) # define attribute_id(a) vinfo((a)+1) # define attribute_value(a) vlink((a)+1) @@ -679,18 +680,23 @@ typedef enum { # define cache_disabled max_halfword extern void delete_attribute_ref(halfword b); +extern void reassign_attribute(halfword n,halfword new); +extern void delete_attribute_ref(halfword b); extern void build_attribute_list(halfword b); +extern halfword current_attribute_list(void); extern int unset_attribute(halfword n, int c, int w); extern void set_attribute(halfword n, int c, int w); extern int has_attribute(halfword n, int c, int w); + extern halfword new_span_node(halfword n, int c, scaled w); extern void print_short_node_contents(halfword n); extern void show_node_list(int i); extern pointer actual_box_width(pointer r, scaled base_width); + /* TH: these two defines still need checking. The node ordering in luatex is not quite the same as in tex82 */ diff --git a/Build/source/texk/web2c/luatexdir/tex/texnodes.w b/Build/source/texk/web2c/luatexdir/tex/texnodes.w index dc1279baa67..04c2c5fee58 100644 --- a/Build/source/texk/web2c/luatexdir/tex/texnodes.w +++ b/Build/source/texk/web2c/luatexdir/tex/texnodes.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: texnodes.w 5112 2014-12-20 08:21:53Z luigi $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/texnodes.w $"; + #include "ptexlib.h" #include "lua/luatex-api.h" @@ -2199,7 +2197,7 @@ void update_attribute_cache(void) void build_attribute_list(halfword b) { if (max_used_attr >= 0) { - if (attr_list_cache == cache_disabled) { + if (attr_list_cache == cache_disabled|| attr_list_cache == null) { update_attribute_cache(); if (attr_list_cache == null) return; @@ -2213,6 +2211,43 @@ void build_attribute_list(halfword b) } } + +@ @c +halfword current_attribute_list(void) +{ + if (max_used_attr >= 0) { + if (attr_list_cache == cache_disabled) { + update_attribute_cache(); + } + return attr_list_cache ; + } + return null ; +} + + +@ @c +void reassign_attribute(halfword n, halfword new) +{ + halfword old; + old = node_attr(n); + if (new == null) { + /* there is nothing to assign but we need to check for an old value */ + if (old != null) + delete_attribute_ref(old); /* also nulls attr field of n */ + } else if (old == null) { + /* nothing is assigned so we just do that now */ + assign_attribute_ref(n,new); + } else if (old != new) { + /* something is assigned so we need to clean up and assign then */ + delete_attribute_ref(old); + assign_attribute_ref(n,new); + } + /* else: same value so there is no need to assign and change the refcount */ + node_attr(n) = new ; +} + + + @ @c void delete_attribute_ref(halfword b) { diff --git a/Build/source/texk/web2c/luatexdir/tex/textcodes.h b/Build/source/texk/web2c/luatexdir/tex/textcodes.h index f81db2dd0a6..4249ce631b1 100644 --- a/Build/source/texk/web2c/luatexdir/tex/textcodes.h +++ b/Build/source/texk/web2c/luatexdir/tex/textcodes.h @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: textcodes.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef TEXTCODES_H # define TEXTCODES_H diff --git a/Build/source/texk/web2c/luatexdir/tex/textcodes.w b/Build/source/texk/web2c/luatexdir/tex/textcodes.w index 08d890dfb3d..6487e821c70 100644 --- a/Build/source/texk/web2c/luatexdir/tex/textcodes.w +++ b/Build/source/texk/web2c/luatexdir/tex/textcodes.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: textcodes.w 4519 2012-12-14 09:11:19Z taco $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/textcodes.w $"; + #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/tex/textoken.h b/Build/source/texk/web2c/luatexdir/tex/textoken.h index f757612fc5d..c2a96b33b40 100644 --- a/Build/source/texk/web2c/luatexdir/tex/textoken.h +++ b/Build/source/texk/web2c/luatexdir/tex/textoken.h @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: textoken.h 4877 2014-03-14 01:26:05Z luigi $ */ #ifndef TEXTOKEN_H # define TEXTOKEN_H diff --git a/Build/source/texk/web2c/luatexdir/tex/textoken.w b/Build/source/texk/web2c/luatexdir/tex/textoken.w index d37b85ae6f8..296e1e6aede 100644 --- a/Build/source/texk/web2c/luatexdir/tex/textoken.w +++ b/Build/source/texk/web2c/luatexdir/tex/textoken.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: textoken.w 5004 2014-05-20 09:23:31Z taco $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/textoken.w $"; + #include "ptexlib.h" @@ -29,6 +27,8 @@ static const char _svn_version[] = #define cat_code_table int_par(cat_code_table_code) #define tracing_nesting int_par(tracing_nesting_code) #define suppress_outer_error int_par(suppress_outer_error_code) +#define suppress_mathpar_error int_par(suppress_mathpar_error_code) + #define every_eof equiv(every_eof_loc) #define box(A) equiv(box_base+(A)) @@ -480,8 +480,9 @@ boolean scan_keyword(const char *s) const char *k; /* index into |str_pool| */ halfword save_cur_cs = cur_cs; int saved_align_state = align_state; - assert (strlen(s) > 1); - p = backup_head; + if (strlen(s) == 0) /* was assert (strlen(s) > 1); */ + return false ; /* but not with newtokenlib zero keyword simply doesn't match */ + p = backup_head; token_link(p) = null; k = s; while (*k) { @@ -1923,6 +1924,7 @@ void conv_toks(void) if (luacstrings > 0) lua_string_start(); } + return; break; case pdf_insert_ht_code: scan_register_num(); |