<div dir="ltr">Not sure if there was something unclear about my earlier message. Anyway, since I did not receive any response, I decided to dig into the source myself, and it seems a bug was introduced in r6219 and is in the file source/texk/web2c/luatexdir/lua/lnodelib.c:<div><br></div><div>The code below (starting at line 3201) always returns an error. That seems wrong. Any comments?</div><div><br></div><div>===</div><div><div>static int lua_nodelib_set_glue(lua_State * L)</div><div>{</div><div>    halfword n = *check_isnode(L, 1);</div><div>    int top = lua_gettop(L) ;</div><div>    if (n) {</div><div>        halfword t = type(n);</div><div>        if (t == glue_node || t == glue_spec_node || t == math_node) {</div><div>            width(n)         = ((top > 1 && lua_type(L, 2) == LUA_TNUMBER)) ? lua_roundnumber(L,2) : 0;</div><div>            stretch(n)       = ((top > 2 && lua_type(L, 3) == LUA_TNUMBER)) ? lua_roundnumber(L,3) : 0;</div><div>            shrink(n)        = ((top > 3 && lua_type(L, 4) == LUA_TNUMBER)) ? lua_roundnumber(L,4) : 0;</div><div>            stretch_order(n) = ((top > 4 && lua_type(L, 5) == LUA_TNUMBER)) ? lua_tointeger(L,5) : 0;</div><div>            shrink_order(n)  = ((top > 5 && lua_type(L, 6) == LUA_TNUMBER)) ? lua_tointeger(L,6) : 0;</div><div>        }</div><div>    }</div><div>    return luaL_error(L, "glue (spec) expected");</div><div>    return 0;</div><div>}</div></div><div><br></div><div>==</div><div><br></div><div>I believe it should be something like:</div><div><br></div><div>==</div><div><div>static int lua_nodelib_set_glue(lua_State * L)</div><div>{</div><div>    halfword n = *check_isnode(L, 1);</div><div>    int top = lua_gettop(L) ;</div><div>    if (n) {</div><div>        halfword t = type(n);</div><div>        if (t == glue_node || t == glue_spec_node || t == math_node) {</div><div>            width(n)         = ((top > 1 && lua_type(L, 2) == LUA_TNUMBER)) ? lua_roundnumber(L,2) : 0;</div><div>            stretch(n)       = ((top > 2 && lua_type(L, 3) == LUA_TNUMBER)) ? lua_roundnumber(L,3) : 0;</div><div>            shrink(n)        = ((top > 3 && lua_type(L, 4) == LUA_TNUMBER)) ? lua_roundnumber(L,4) : 0;</div><div>            stretch_order(n) = ((top > 4 && lua_type(L, 5) == LUA_TNUMBER)) ? lua_tointeger(L,5) : 0;</div><div>            shrink_order(n)  = ((top > 5 && lua_type(L, 6) == LUA_TNUMBER)) ? lua_tointeger(L,6) : 0;</div><div>            return 0;<br></div><div>        }</div><div>    }</div><div>    return luaL_error(L, "glue (spec) expected");</div><div>}</div></div><div>==</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 20, 2017 at 2:27 PM, Deepak Jois <span dir="ltr"><<a href="mailto:deepak.jois@gmail.com" target="_blank">deepak.jois@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I just compiled the latest LuaTeX at r6317 and some code that worked earlier doesn’t anymore.</div><div><br></div><div>This fails with error message  (font_params is defined earlier): "glue (spec) expected"</div><div>    </div><div>     n = node.new("glue", 13)<br></div><div>     node.setglue(n, font_params.space, font_params.space_stretch, font_params.space_shrink)<br></div><div><br></div><div>but changing to this works:<div><br></div><div><div>      n = node.new("glue", 13)</div><div>      n.width = font_params.space</div><div>      n.stretch = font_params.space_stretch</div><div>      n.shrink = font_params.space_shrink</div></div></div><div><br></div><div>I am using the node.setglue function as instructed the manual. Am I doing something wrong?</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Deepak</div></font></span></div>
</blockquote></div><br></div>