diff options
author | Hans Hagen <pragma@wxs.nl> | 2022-12-05 23:11:09 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2022-12-05 23:11:09 +0100 |
commit | 265ba2a85e0945a37972e22f23bcaac16d6c08a1 (patch) | |
tree | 356963c1df5c5ed8a6189eeb3346970081a29af4 /source/luametatex/source/tex/textoken.c | |
parent | 08fa92c1c94d9faddee48590a1a20506e89c191c (diff) | |
download | context-265ba2a85e0945a37972e22f23bcaac16d6c08a1.tar.gz |
2022-12-05 18:51:00
Diffstat (limited to 'source/luametatex/source/tex/textoken.c')
-rw-r--r-- | source/luametatex/source/tex/textoken.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/source/luametatex/source/tex/textoken.c b/source/luametatex/source/tex/textoken.c index ba457491a..b46e6de85 100644 --- a/source/luametatex/source/tex/textoken.c +++ b/source/luametatex/source/tex/textoken.c @@ -2078,6 +2078,28 @@ halfword tex_get_token(void) return cur_tok; } +/*tex + + The |get_x_or_protected| procedure is like |get_x_token| except that protected macros are not + expanded. It sets |cur_cmd|, |cur_chr|, |cur_tok|, and expands non-protected macros. + +*/ + +void tex_get_x_or_protected(void) +{ + lmt_hash_state.no_new_cs = 0; + while (1) { + tex_get_next(); + if (cur_cmd <= max_command_cmd || is_protected_cmd(cur_cmd)) { + break; + } else { + tex_expand_current_token(); + } + } + cur_tok = cur_cs ? cs_token_flag + cur_cs : token_val(cur_cmd, cur_chr); /* needed afterwards ? */ + lmt_hash_state.no_new_cs = 1; +} + /*tex This changes the string |s| to a token list. */ halfword tex_string_to_toks(const char *ss) @@ -2765,6 +2787,16 @@ void tex_run_convert_tokens(halfword code) pop_selector; break; } + /* + case cs_lastname_code: + if (lmt_scanner_state.last_cs_name != null_cs) { + int saved_selector; + push_selector; + tex_print_cs_name(lmt_scanner_state.last_cs_name); + pop_selector; + } + break; + */ case detokenized_code: { int saved_selector; |