summaryrefslogtreecommitdiff
path: root/source/luametatex/source/tex/texexpand.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/luametatex/source/tex/texexpand.c')
-rw-r--r--source/luametatex/source/tex/texexpand.c19
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: */
/*