texlive[41832] Build/source/texk/web2c/luatexdir: luatexdir: sync

commits+kakuto at tug.org commits+kakuto at tug.org
Wed Aug 10 15:30:12 CEST 2016


Revision: 41832
          http://tug.org/svn/texlive?view=revision&revision=41832
Author:   kakuto
Date:     2016-08-10 15:30:12 +0200 (Wed, 10 Aug 2016)
Log Message:
-----------
luatexdir: sync with the upstream

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/luatexdir/lang/texlang.w
    trunk/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
    trunk/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
    trunk/Build/source/texk/web2c/luatexdir/lua/ltexlib.c
    trunk/Build/source/texk/web2c/luatexdir/luatex.c
    trunk/Build/source/texk/web2c/luatexdir/tex/mathcodes.w
    trunk/Build/source/texk/web2c/luatexdir/tex/mlist.w

Modified: trunk/Build/source/texk/web2c/luatexdir/lang/texlang.w
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/lang/texlang.w	2016-08-10 01:16:33 UTC (rev 41831)
+++ trunk/Build/source/texk/web2c/luatexdir/lang/texlang.w	2016-08-10 13:30:12 UTC (rev 41832)
@@ -462,7 +462,11 @@
 void set_disc_field(halfword f, halfword t)
 {
     if (t != null) {
-        couple_nodes(f, t);
+        /*
+            couple_nodes(f, t); // better not expose f as prev pointer
+        */
+        vlink(f) = t ;
+        alink(t) = null ;
         tlink(f) = tail_of_list(t);
     } else {
         vlink(f) = null;

Modified: trunk/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/lua/lnodelib.c	2016-08-10 01:16:33 UTC (rev 41831)
+++ trunk/Build/source/texk/web2c/luatexdir/lua/lnodelib.c	2016-08-10 13:30:12 UTC (rev 41832)
@@ -4688,6 +4688,8 @@
 
 /* this is too simplistic, but it helps Hans to get going */
 
+/*
+
 static halfword do_ligature_n(halfword prev, halfword stop, halfword lig)
 {
     vlink(lig) = vlink(stop);
@@ -4697,8 +4699,12 @@
     return lig;
 }
 
+*/
+
 /* node.do_ligature_n(node prev, node last, node lig) */
 
+/*
+
 static int lua_nodelib_do_ligature_n(lua_State * L)
 {
     halfword p;
@@ -4718,8 +4724,12 @@
     return 1;
 }
 
+*/
+
 /* node.direct.do_ligature_n(node prev, node last, node lig) */
 
+/*
+
 static int lua_nodelib_direct_do_ligature_n(lua_State * L)
 {
     halfword p;
@@ -4742,6 +4752,8 @@
     return 1;
 }
 
+*/
+
 /* node.usedlist */
 
 static int lua_nodelib_usedlist(lua_State * L)
@@ -6782,7 +6794,6 @@
     return 1;
 }
 
-
 static int lua_nodelib_direct_effective_glue(lua_State * L)
 {
     halfword glue = lua_tointeger(L, 1);
@@ -6807,7 +6818,71 @@
     return 1;
 }
 
+/*
+    Disc nodes are kind of special in the sense that their head is not the head as we
+    see it, but a special node that has status info of which head and tail are part.
+    Normally when proper set/get functions are used this status node is all right but
+    if a macro package permits arbitrary messing around, then it can at some point
+    call the following cleaner, just before linebreaking kicks in. This one is not
+    called automatically because if significantly slows down the line break routing.
 
+*/
+
+#define check_disc(c) \
+    p = c ; \
+    if (p != null && vlink(p) != null) \
+        tlink(p) = tail_of_list(vlink(p));
+
+static int lua_nodelib_direct_check_discretionaries(lua_State * L) {
+    halfword c = lua_tointeger(L, 1);
+    halfword p ;
+    while (c != null) {
+        if (type(c) == disc_node) {
+            check_disc(no_break(c)) ;
+            check_disc(pre_break(c)) ;
+            check_disc(post_break(c)) ;
+        }
+        c = vlink(c) ;
+    }
+    return 0;
+}
+
+static int lua_nodelib_direct_check_discretionary(lua_State * L) {
+    halfword c = lua_tointeger(L, 1);
+    if (c != null && type(c) == disc_node) {
+        halfword p ;
+        check_disc(no_break(c)) ;
+        check_disc(pre_break(c)) ;
+        check_disc(post_break(c)) ;
+    }
+    return 0;
+}
+
+static int lua_nodelib_check_discretionaries(lua_State * L) {
+    halfword c = *check_isnode(L, 1);
+    halfword p ;
+    while (c != null) {
+        if (type(c) == disc_node) {
+            check_disc(no_break(c)) ;
+            check_disc(pre_break(c)) ;
+            check_disc(post_break(c)) ;
+        }
+        c = vlink(c) ;
+    }
+    return 0;
+}
+
+static int lua_nodelib_check_discretionary(lua_State * L) {
+    halfword c = *check_isnode(L, 1);
+    if (c != null && type(c) == disc_node) {
+        halfword p ;
+        check_disc(no_break(c)) ;
+        check_disc(pre_break(c)) ;
+        check_disc(post_break(c)) ;
+    }
+    return 0;
+}
+
 static const struct luaL_Reg nodelib_p[] = {
     {"__index",    lua_nodelib_get_property_t},
     {"__newindex", lua_nodelib_set_property_t},
@@ -6836,7 +6911,7 @@
     {"count", lua_nodelib_direct_count},
     {"current_attr", lua_nodelib_direct_currentattr},
     {"dimensions", lua_nodelib_direct_dimensions},
-    {"do_ligature_n", lua_nodelib_direct_do_ligature_n},
+ /* {"do_ligature_n", lua_nodelib_direct_do_ligature_n}, */
     {"end_of_math", lua_nodelib_direct_end_of_math},
  /* {"family_font", lua_nodelib_mfont}, */ /* no node argument */
  /* {"fields", lua_nodelib_fields}, */ /* no node argument */
@@ -6917,6 +6992,8 @@
     {"getproperty", lua_nodelib_direct_get_property},
     {"setproperty", lua_nodelib_direct_set_property},
     {"effective_glue", lua_nodelib_direct_effective_glue},
+    {"check_discretionary", lua_nodelib_direct_check_discretionary},
+    {"check_discretionaries", lua_nodelib_direct_check_discretionaries},
     /* done */
     {NULL, NULL} /* sentinel */
 };
@@ -6929,7 +7006,7 @@
     {"count", lua_nodelib_count},
     {"current_attr", lua_nodelib_currentattr},
     {"dimensions", lua_nodelib_dimensions},
-    {"do_ligature_n", lua_nodelib_do_ligature_n},
+ /* {"do_ligature_n", lua_nodelib_do_ligature_n}, */
     {"end_of_math", lua_nodelib_end_of_math},
     {"family_font", lua_nodelib_mfont},
     {"fields", lua_nodelib_fields},
@@ -7004,6 +7081,8 @@
     {"getproperty", lua_nodelib_get_property}, /* hh experiment */
     {"setproperty", lua_nodelib_set_property}, /* hh experiment */
     {"effective_glue", lua_nodelib_effective_glue},
+    {"check_discretionary", lua_nodelib_check_discretionary},
+    {"check_discretionaries", lua_nodelib_check_discretionaries},
     /* done */
     {NULL, NULL} /* sentinel */
 };

Modified: trunk/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/lua/lpdflib.c	2016-08-10 01:16:33 UTC (rev 41831)
+++ trunk/Build/source/texk/web2c/luatexdir/lua/lpdflib.c	2016-08-10 13:30:12 UTC (rev 41832)
@@ -907,6 +907,13 @@
     return 1 ;
 }
 
+static int getpdfcreationdate(lua_State * L)
+{
+    initialize_start_time(static_pdf);
+    lua_pushstring(L,static_pdf->start_time_str);
+    return 1 ;
+}
+
 static int getpdfminorversion(lua_State * L)
 {
  /* lua_pushinteger(L,static_pdf->minor_version); */
@@ -1154,6 +1161,7 @@
     { "fontsize", getpdffontsize },
     { "xformname", getpdfxformname },
     { "getversion", getpdfversion },
+    { "getcreationdate", getpdfcreationdate },
     { "getminorversion", getpdfminorversion },
     { "setminorversion", setpdfminorversion },
     { "newcolorstack", newpdfcolorstack },

Modified: trunk/Build/source/texk/web2c/luatexdir/lua/ltexlib.c
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/lua/ltexlib.c	2016-08-10 01:16:33 UTC (rev 41831)
+++ trunk/Build/source/texk/web2c/luatexdir/lua/ltexlib.c	2016-08-10 13:30:12 UTC (rev 41832)
@@ -1388,6 +1388,7 @@
     return 1;
 }
 
+/*
 
 static int setmathcode(lua_State * L)
 {
@@ -1426,6 +1427,52 @@
     return 0;
 }
 
+*/
+
+/*
+    [global] code { c f ch }
+    [global] code   c f ch   (a bit easier on memory, counterpart of getter)
+*/
+
+static int setmathcode(lua_State * L)
+{
+    int ch;
+    halfword cval, fval, chval;
+    int level = cur_level;
+    int f = 1;
+    if (lua_type(L,1) == LUA_TSTRING) {
+        const char *s = lua_tostring(L,1);
+        if (lua_key_eq(s,global)) {
+            level = level_one;
+            f = 2;
+        }
+    }
+    ch = luaL_checkinteger(L, f);
+    check_char_range(ch, "setmathcode", 65536*17);
+    f += 1 ;
+    if (lua_type(L,f) == LUA_TNUMBER) {
+        cval = luaL_checkinteger(L, f);
+        fval = luaL_checkinteger(L, f+1);
+        chval = luaL_checkinteger(L, f+2);
+    } else if (lua_type(L,f) == LUA_TTABLE) {
+        lua_rawgeti(L, f, 1);
+        cval = (halfword) luaL_checkinteger(L, -1);
+        lua_rawgeti(L, f, 2);
+        fval = (halfword) luaL_checkinteger(L, -1);
+        lua_rawgeti(L, f, 3);
+        chval = (halfword) luaL_checkinteger(L, -1);
+        lua_pop(L,3);
+    } else {
+        luaL_error(L, "Bad arguments for tex.setmathcode()");
+        return 0;
+    }
+    check_char_range(cval, "setmathcode", 8);
+    check_char_range(fval, "setmathcode", 256);
+    check_char_range(chval, "setmathcode", 65536*17);
+    set_math_code(ch, cval,fval, chval, (quarterword) (level));
+    return 0;
+}
+
 static int getmathcode(lua_State * L)
 {
     mathcodeval mval = { 0, 0, 0 };
@@ -1454,6 +1501,8 @@
     return 3;
 }
 
+/*
+
 static int setdelcode(lua_State * L)
 {
     int ch;
@@ -1494,6 +1543,56 @@
     return 0;
 }
 
+*/
+
+/*
+    [global] code { c f ch }
+    [global] code   c f ch   (a bit easier on memory, counterpart of getter)
+*/
+
+static int setdelcode(lua_State * L)
+{
+    int ch;
+    halfword sfval, scval, lfval, lcval;
+    int level = cur_level;
+    int f = 1;
+    if (lua_type(L,1) == LUA_TSTRING) {
+        const char *s = lua_tostring(L,1);
+        if (lua_key_eq(s,global)) {
+            level = level_one;
+            f = 2;
+        }
+    }
+    ch = luaL_checkinteger(L, f);
+    check_char_range(ch, "setdelcode", 65536*17);
+    f += 1;
+    if (lua_type(L,f) == LUA_TNUMBER) {
+        sfval = luaL_checkinteger(L, f);
+        scval = luaL_checkinteger(L, f+1);
+        lfval = luaL_checkinteger(L, f+2);
+        lcval = luaL_checkinteger(L, f+3);
+    } else if (lua_type(L,f) == LUA_TTABLE) {
+        lua_rawgeti(L, f, 1);
+        sfval = (halfword) luaL_checkinteger(L, -1);
+        lua_rawgeti(L, f, 2);
+        scval = (halfword) luaL_checkinteger(L, -1);
+        lua_rawgeti(L, f, 3);
+        lfval = (halfword) luaL_checkinteger(L, -1);
+        lua_rawgeti(L, f, 4);
+        lcval = (halfword) luaL_checkinteger(L, -1);
+        lua_pop(L,4);
+    } else {
+        luaL_error(L, "Bad arguments for tex.setdelcode()");
+        return 0;
+    }
+    check_char_range(sfval, "setdelcode", 256);
+    check_char_range(scval, "setdelcode", 65536*17);
+    check_char_range(lfval, "setdelcode", 256);
+    check_char_range(lcval, "setdelcode", 65536*17);
+    set_del_code(ch, sfval, scval, lfval, lcval, (quarterword) (level));
+    return 0;
+}
+
 static int getdelcode(lua_State * L)
 {
     delcodeval mval = { 0, 0, 0, 0, 0 };

Modified: trunk/Build/source/texk/web2c/luatexdir/luatex.c
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/luatex.c	2016-08-10 01:16:33 UTC (rev 41831)
+++ trunk/Build/source/texk/web2c/luatexdir/luatex.c	2016-08-10 13:30:12 UTC (rev 41832)
@@ -28,10 +28,10 @@
 
 #define TeX
 
-int luatex_version = 97;        /* \.{\\luatexversion}  */
-int luatex_revision = '0';      /* \.{\\luatexrevision}  */
-int luatex_date_info = 2016060720;     /* the compile date is now hardwired */
-const char *luatex_version_string = "0.97.0";
+int luatex_version = 98;        /* \.{\\luatexversion}  */
+int luatex_revision = '1';      /* \.{\\luatexrevision}  */
+int luatex_date_info = 2016081014;     /* the compile date is now hardwired */
+const char *luatex_version_string = "0.98.1";
 const char *engine_name = my_name;     /* the name of this engine */
 
 #include <kpathsea/c-ctype.h>

Modified: trunk/Build/source/texk/web2c/luatexdir/tex/mathcodes.w
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/mathcodes.w	2016-08-10 01:16:33 UTC (rev 41831)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/mathcodes.w	2016-08-10 13:30:12 UTC (rev 41832)
@@ -252,7 +252,7 @@
                 end_diagnostic(false);
             }
         }
-        (mathcode_head->stack_ptr)--;
+        (delcode_head->stack_ptr)--;
     }
 }
 

Modified: trunk/Build/source/texk/web2c/luatexdir/tex/mlist.w
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/mlist.w	2016-08-10 01:16:33 UTC (rev 41831)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/mlist.w	2016-08-10 13:30:12 UTC (rev 41832)
@@ -2430,7 +2430,6 @@
             delta1 = clr1 - ((shift_up   - depth(x) ) - (math_axis_size(cur_size) + delta));
             delta2 = clr2 - ((shift_down - height(z)) + (math_axis_size(cur_size) - delta));
         } else {
-            delta = half(thickness(q));
             clr1 = ext_xn_over_d(clr1, thickness(q), fraction_rule(cur_style));
             clr2 = ext_xn_over_d(clr2, thickness(q), fraction_rule(cur_style));
             delta1 = clr1 - ((shift_up   - depth(x) ) - (math_axis_size(cur_size) + delta));



More information about the tex-live-commits mailing list