summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2015-11-17 14:39:18 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2015-11-17 14:39:18 +0000
commit441184c35307328cada5a81c27b34312eeac50cb (patch)
treedca33b575d14a3a993e8e181a8b039bd96f31013 /Build
parentde2e5d56312985b565d1bdfa46256590029aa0bf (diff)
web2c/luatexdir: Sync with the upstream.
git-svn-id: svn://tug.org/texlive/trunk@38881 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lnodelib.c55
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/extensions.w6
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/textoken.w10
3 files changed, 37 insertions, 34 deletions
diff --git a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
index 7fdddc3d066..fed975719c8 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
@@ -5540,9 +5540,11 @@ static int lua_nodelib_direct_setcharacter(lua_State * L)
{
halfword n;
n = (halfword ) lua_tonumber(L, 1);
- if (n) {
- if ((type(n) == glyph_node) && (lua_type(L, 2) == LUA_TNUMBER)) {
+ if ((n) && (lua_type(L, 2) == LUA_TNUMBER)) {
+ if (type(n) == glyph_node) {
character(n) = (halfword) lua_tointeger(L, 2);
+ } else if ((type(n) == math_char_node) || (type(n) == math_text_char_node)) {
+ math_character(n) = (halfword) lua_tointeger(L, 2);
}
}
return 0;
@@ -6196,28 +6198,44 @@ static int lua_nodelib_direct_getbox(lua_State * L)
return 1;
}
-static int direct_vsetbox(lua_State * L, int is_global)
+/* node.setbox = tex.setbox */
+/* node.setbox */
+
+static int lua_nodelib_direct_setbox(lua_State * L)
{
- int j, k, err;
- int save_global_defs = int_par(global_defs_code);
- if (is_global)
- int_par(global_defs_code) = 1;
+ int isglobal = 0;
+ int j, k, err, t;
+ int save_global_defs ;
+ int n = lua_gettop(L);
+ if (n == 3 && (lua_type(L, 1) == LUA_TSTRING)) {
+ const char *s = lua_tostring(L, 1);
+ if (lua_key_eq(s, global))
+ isglobal = 1;
+ }
+ t = lua_type(L, -1);
k = direct_get_box_id(L, -2);
direct_check_index_range(k, "setbox");
- if (lua_isboolean(L, -1)) {
+ if (t == LUA_TBOOLEAN) {
j = lua_toboolean(L, -1);
- if (j == 0)
+ if (j == 0) {
j = null;
- else
+ } else {
return 0;
+ }
+ } else if (t == LUA_TNIL) {
+ j = null;
} else {
- j=nodelib_popdirect(-1);
+ j = nodelib_popdirect(-1);
if (j != null && type(j) != hlist_node && type(j) != vlist_node) {
luaL_error(L, "setbox: incompatible node type (%s)\n",get_node_name(type(j), subtype(j)));
return 0;
}
}
+ save_global_defs = int_par(global_defs_code);
+ if (isglobal) {
+ int_par(global_defs_code) = 1;
+ }
err = set_tex_box_register(k, j);
int_par(global_defs_code) = save_global_defs;
if (err) {
@@ -6226,21 +6244,6 @@ static int direct_vsetbox(lua_State * L, int is_global)
return 0;
}
-/* node.setbox = tex.setbox */
-/* node.setbox */
-
-static int lua_nodelib_direct_setbox(lua_State * L)
-{
- int isglobal = 0;
- int n = lua_gettop(L);
- if (n == 3 && (lua_type(L, 1) == LUA_TSTRING)) {
- const char *s = lua_tostring(L, 1);
- if (lua_key_eq(s, global))
- isglobal = 1;
- }
- return direct_vsetbox(L, isglobal);
-}
-
/* node.is_node(n) */
static int lua_nodelib_is_node(lua_State * L)
diff --git a/Build/source/texk/web2c/luatexdir/tex/extensions.w b/Build/source/texk/web2c/luatexdir/tex/extensions.w
index fee0d3d025e..587b0ea85c3 100644
--- a/Build/source/texk/web2c/luatexdir/tex/extensions.w
+++ b/Build/source/texk/web2c/luatexdir/tex/extensions.w
@@ -136,7 +136,7 @@ void do_extension_dvi(int immediate)
scan_toks(false, true);
write_tokens(tail) = def_ref;
} else {
- normal_error("dvi backend", "unknown \\dviextension");
+ tex_error("unexpected use of \\dviextension",null);
}
}
@@ -328,7 +328,7 @@ void do_extension_pdf(int immediate)
pdf_trailer_toks = concat_tokens(pdf_trailer_toks, def_ref);
break;
default:
- normal_error("pdf backend", "unknown \\pdfextension keyword");
+ tex_error("unexpected use of \\pdfextension",null);
break ;
}
}
@@ -498,7 +498,7 @@ void do_extension(int immediate)
if (immediate) {
back_input();
} else {
- confusion("ext1x");
+ confusion("invalid extension");
}
break;
}
diff --git a/Build/source/texk/web2c/luatexdir/tex/textoken.w b/Build/source/texk/web2c/luatexdir/tex/textoken.w
index dc010805116..f98cd8ea223 100644
--- a/Build/source/texk/web2c/luatexdir/tex/textoken.w
+++ b/Build/source/texk/web2c/luatexdir/tex/textoken.w
@@ -1505,7 +1505,7 @@ halfword string_to_toks(const char *ss)
halfword p; /* tail of the token list */
halfword q; /* new node being added to the token list via |store_new_token| */
halfword t; /* token being appended */
- const char *s = ss;
+ const char *s = ss;
const char *se = ss + strlen(s);
p = temp_token_head;
set_token_link(p, null);
@@ -2287,13 +2287,13 @@ void conv_toks(void)
case dvi_variable_code:
done = conv_var_dvi(c);
if (done==0)
- confusion("dvi variable");
+ tex_error("unexpected use of \\dvivariable",null);
return;
break;
case pdf_variable_code:
done = conv_var_pdf(c);
if (done==0)
- confusion("pdf variable");
+ tex_error("unexpected use of \\pdfvariable",null);
return;
break;
case dvi_feedback_code:
@@ -2302,7 +2302,7 @@ void conv_toks(void)
else
done = 0;
if (done==0)
- confusion("dvi feedback");
+ tex_error("unexpected use of \\dvifeedback",null);
else if (done==2)
return;
break;
@@ -2312,7 +2312,7 @@ void conv_toks(void)
else
done = 0;
if (done==0)
- confusion("pdf feedback");
+ tex_error("unexpected use of \\pdffeedback",null);
else if (done==2)
return;
break;