summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2016-08-10 13:30:12 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2016-08-10 13:30:12 +0000
commitb1e8a75b34e67fccc72dc314ee3b2b4de9e477e8 (patch)
tree90d9daa4a7698a12da3c71bfade684fdf1a4e436 /Build
parent2f7bf8fc2aaf1fb0675dea04787406d700dc3a18 (diff)
luatexdir: sync with the upstream
git-svn-id: svn://tug.org/texlive/trunk@41832 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/luatexdir/lang/texlang.w6
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lnodelib.c85
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lpdflib.c8
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/ltexlib.c99
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex.c8
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/mathcodes.w2
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/mlist.w1
7 files changed, 199 insertions, 10 deletions
diff --git a/Build/source/texk/web2c/luatexdir/lang/texlang.w b/Build/source/texk/web2c/luatexdir/lang/texlang.w
index f89ca5d4a33..f6dcfdb9153 100644
--- a/Build/source/texk/web2c/luatexdir/lang/texlang.w
+++ b/Build/source/texk/web2c/luatexdir/lang/texlang.w
@@ -462,7 +462,11 @@ halfword insert_character(halfword t, int c)
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;
diff --git a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
index c4706e43331..91d85256230 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
@@ -4688,6 +4688,8 @@ static int lua_nodelib_direct_has_glyph(lua_State * L)
/* 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 @@ static halfword do_ligature_n(halfword prev, halfword stop, halfword lig)
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 @@ static int lua_nodelib_do_ligature_n(lua_State * L)
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 @@ static int lua_nodelib_direct_do_ligature_n(lua_State * L)
return 1;
}
+*/
+
/* node.usedlist */
static int lua_nodelib_usedlist(lua_State * L)
@@ -6782,7 +6794,6 @@ static int lua_nodelib_effective_glue(lua_State * L)
return 1;
}
-
static int lua_nodelib_direct_effective_glue(lua_State * L)
{
halfword glue = lua_tointeger(L, 1);
@@ -6807,6 +6818,70 @@ static int lua_nodelib_direct_effective_glue(lua_State * L)
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},
@@ -6836,7 +6911,7 @@ static const struct luaL_Reg direct_nodelib_f[] = {
{"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 @@ static const struct luaL_Reg direct_nodelib_f[] = {
{"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 @@ static const struct luaL_Reg nodelib_f[] = {
{"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 @@ static const struct luaL_Reg nodelib_f[] = {
{"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 */
};
diff --git a/Build/source/texk/web2c/luatexdir/lua/lpdflib.c b/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
index de82be7479e..4037bacd81b 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
@@ -907,6 +907,13 @@ static int getpdfversion(lua_State * L)
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 @@ static const struct luaL_Reg pdflib[] = {
{ "fontsize", getpdffontsize },
{ "xformname", getpdfxformname },
{ "getversion", getpdfversion },
+ { "getcreationdate", getpdfcreationdate },
{ "getminorversion", getpdfminorversion },
{ "setminorversion", setpdfminorversion },
{ "newcolorstack", newpdfcolorstack },
diff --git a/Build/source/texk/web2c/luatexdir/lua/ltexlib.c b/Build/source/texk/web2c/luatexdir/lua/ltexlib.c
index 0966176b1e2..885981ae9ad 100644
--- a/Build/source/texk/web2c/luatexdir/lua/ltexlib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/ltexlib.c
@@ -1388,6 +1388,7 @@ static int getcatcode(lua_State * L)
return 1;
}
+/*
static int setmathcode(lua_State * L)
{
@@ -1426,6 +1427,52 @@ static int setmathcode(lua_State * L)
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 @@ static int getmathcodes(lua_State * L)
return 3;
}
+/*
+
static int setdelcode(lua_State * L)
{
int ch;
@@ -1494,6 +1543,56 @@ static int setdelcode(lua_State * L)
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 };
diff --git a/Build/source/texk/web2c/luatexdir/luatex.c b/Build/source/texk/web2c/luatexdir/luatex.c
index f4b2945d970..3a720290577 100644
--- a/Build/source/texk/web2c/luatexdir/luatex.c
+++ b/Build/source/texk/web2c/luatexdir/luatex.c
@@ -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>
diff --git a/Build/source/texk/web2c/luatexdir/tex/mathcodes.w b/Build/source/texk/web2c/luatexdir/tex/mathcodes.w
index 8c0760ae51e..a0a357e5319 100644
--- a/Build/source/texk/web2c/luatexdir/tex/mathcodes.w
+++ b/Build/source/texk/web2c/luatexdir/tex/mathcodes.w
@@ -252,7 +252,7 @@ static void unsavedelcode(quarterword gl)
end_diagnostic(false);
}
}
- (mathcode_head->stack_ptr)--;
+ (delcode_head->stack_ptr)--;
}
}
diff --git a/Build/source/texk/web2c/luatexdir/tex/mlist.w b/Build/source/texk/web2c/luatexdir/tex/mlist.w
index 331be47de7d..ace56be8627 100644
--- a/Build/source/texk/web2c/luatexdir/tex/mlist.w
+++ b/Build/source/texk/web2c/luatexdir/tex/mlist.w
@@ -2430,7 +2430,6 @@ static void make_fraction(pointer q, int cur_style)
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));