diff options
author | Hans Hagen <pragma@wxs.nl> | 2022-11-14 23:18:10 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2022-11-14 23:18:10 +0100 |
commit | 08473f11287cb263079c0435068312cbc6d736e8 (patch) | |
tree | 2548fb8b58e18a507e54fa8426a79c6956c3ef2e /source/luametatex/source/tex/texexpand.c | |
parent | dd0a80e5ec42f60832e7d5dc47210e6f3545c400 (diff) | |
download | context-08473f11287cb263079c0435068312cbc6d736e8.tar.gz |
2022-11-14 22:56:00
Diffstat (limited to 'source/luametatex/source/tex/texexpand.c')
-rw-r--r-- | source/luametatex/source/tex/texexpand.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/source/luametatex/source/tex/texexpand.c b/source/luametatex/source/tex/texexpand.c index a0416d118..e74a9c08d 100644 --- a/source/luametatex/source/tex/texexpand.c +++ b/source/luametatex/source/tex/texexpand.c @@ -528,13 +528,22 @@ void tex_expand_current_token(void) default: /* Maybe ... or maybe an option */ // if (lmt_expand_state.cs_name_level == 0) { - /*tex Complain about an undefined macro */ - tex_handle_error( - normal_error_type, - "Undefined control sequence %m", cur_cs, - "The control sequence at the end of the top line of your error message was never\n" - "\\def'ed. You can just continue as I'll forget about whatever was undefined." - ); + if (tex_cs_state(cur_cs) == cs_undefined_error) { + /*tex Complain about an undefined macro */ + tex_handle_error( + normal_error_type, + "Undefined control sequence %m", cur_cs, + "The control sequence at the end of the top line of your error message was never\n" + "\\def'ed. You can just continue as I'll forget about whatever was undefined." + ); + } else { + /*tex We ended up in a situation that is unlikely to happen in traditional \TEX. */ + tex_handle_error( + normal_error_type, + "Control sequence expected instead of %C", cur_cmd, cur_chr, + "You injected something that confused the parser, maybe by using some Lua call." + ); + } // } break; } @@ -1027,7 +1036,7 @@ static void tex_aux_macro_call(halfword cs, halfword cmd, halfword chr) s = null; goto BAD; } - break; + // break; case thrash_match_token: match = 0; thrash = 1; |