diff options
author | Hans Hagen <pragma@wxs.nl> | 2022-12-01 13:43:10 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2022-12-01 13:43:10 +0100 |
commit | 08fa92c1c94d9faddee48590a1a20506e89c191c (patch) | |
tree | 12bbf6fa56b69c47340d4c15f8f601be2d9487b5 /source/luametatex/source/tex/texexpand.c | |
parent | 2593c827482f6c5a315d504cd5316879d6172656 (diff) | |
download | context-08fa92c1c94d9faddee48590a1a20506e89c191c.tar.gz |
2022-12-01 12:41:00
Diffstat (limited to 'source/luametatex/source/tex/texexpand.c')
-rw-r--r-- | source/luametatex/source/tex/texexpand.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/source/luametatex/source/tex/texexpand.c b/source/luametatex/source/tex/texexpand.c index e74a9c08d..cec254d2b 100644 --- a/source/luametatex/source/tex/texexpand.c +++ b/source/luametatex/source/tex/texexpand.c @@ -251,7 +251,7 @@ void tex_expand_current_token(void) case expand_token_code: { /* we can share code with lmtokenlib .. todo */ - halfword cat = tex_scan_category_code(); + halfword cat = tex_scan_category_code(0); halfword chr = tex_scan_char_number(0); /* too fragile: halfword tok = null; @@ -304,6 +304,7 @@ void tex_expand_current_token(void) case spacer_cmd: case letter_cmd: case other_char_cmd: + case active_char_cmd: /* new */ cur_tok = token_val(cmd, eq_value(cur_cs)); break; } @@ -322,6 +323,20 @@ void tex_expand_current_token(void) } break; } + case expand_active_code: + { + tex_get_token(); + if (cur_cmd == active_char_cmd) { + cur_cs = tex_active_to_cs(cur_chr, ! lmt_hash_state.no_new_cs); + if (cur_cs) { + cur_tok = cs_token_flag + cur_cs; + } else { + cur_tok = token_val(cur_cmd, cur_chr); + } + } + tex_back_input(cur_tok); + break; + } case semi_expand_code: { tex_get_token(); @@ -618,12 +633,12 @@ static int tex_aux_collect_cs_tokens(halfword *p, int *n) case spacer_cmd: case letter_cmd: case other_char_cmd: + case active_char_cmd: /* new */ // cur_tok = token_val(cur_cmd, cur_chr); // *p = tex_store_new_token(*p, cur_tok); *p = tex_store_new_token(*p, token_val(cur_cmd, cur_chr)); *n += 1; break; - /* case active_char_cmd: */ /* case comment_cmd: */ /* case invalid_char_cmd: */ /* |