diff options
Diffstat (limited to 'source/luametatex/source/lua/lmttexlib.c')
-rw-r--r-- | source/luametatex/source/lua/lmttexlib.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/luametatex/source/lua/lmttexlib.c b/source/luametatex/source/lua/lmttexlib.c index 7d9395eb7..0d84eebdd 100644 --- a/source/luametatex/source/lua/lmttexlib.c +++ b/source/luametatex/source/lua/lmttexlib.c @@ -903,7 +903,7 @@ static const char *texlib_aux_scan_integer_part(lua_State *L, const char *ss, in DONE: if (overflow) { luaL_error(L, "number too big"); - result = infinity; + result = max_integer; } else if (vacuous) { luaL_error(L, "missing number, treated as zero") ; } @@ -1246,6 +1246,9 @@ int lmt_check_for_flags(lua_State *L, int slot, int *flags, int prefixes, int nu } else if (lua_key_eq(str, value)) { slot += 1; *flags = add_value_flag(*flags); + } else if (lua_key_eq(str, constant)) { + slot += 1; + *flags = add_constant_flag(*flags); } else if (lua_key_eq(str, conditional) || lua_key_eq(str, condition)) { /* condition will go, conditional stays */ slot += 1; @@ -2690,7 +2693,7 @@ static int texlib_aux_scan_internal(lua_State *L, int cmd, int code, int values) default: { int texstr = tex_the_scanned_result(); - char *str = tex_to_cstring(texstr); + const char *str = tex_to_cstring(texstr); if (str) { lua_pushstring(L, str); } else { @@ -3582,7 +3585,7 @@ static int texlib_enableprimitives(lua_State *L) for (int cs = 0; cs < prim_size; cs++) { strnumber s = get_prim_text(cs); if (s > 0) { - char *prm = tex_to_cstring(s); + const char *prm = tex_to_cstring(s); texlib_aux_enableprimitive(pre, lpre, prm); } } @@ -4116,7 +4119,7 @@ static int texlib_runlocal(lua_State *L) } else { halfword ref = eq_value(cs); halfword head = token_link(ref); - if (head && get_token_parameters(ref)) { + if (head && get_token_preamble(ref)) { tex_local_control_message("macro takes arguments and is ignored"); return 0; } else { @@ -4605,7 +4608,7 @@ static int texlib_setdimensionvalue(lua_State *L) static int texlib_aux_getvalue(lua_State *L, halfword level, halfword cs) { halfword chr = eq_value(cs); - if (chr && ! get_token_parameters(chr)) { + if (chr && ! get_token_preamble(chr)) { /* or get_token_parameters as we don't want trailing # */ halfword value = 0; tex_begin_inserted_list(tex_get_available_token(cs_token_flag + cs)); if (tex_scan_tex_value(level, &value)) { |