From 63bb70d210dc6e8a17959c4e056fe41da3f1c398 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Fri, 19 Jun 2020 12:25:31 +0200 Subject: 2020-06-19 11:07:00 --- tex/context/base/mkiv/toks-ini.lua | 82 ++++++++++++++++++++++++++------------ 1 file changed, 57 insertions(+), 25 deletions(-) (limited to 'tex/context/base/mkiv/toks-ini.lua') diff --git a/tex/context/base/mkiv/toks-ini.lua b/tex/context/base/mkiv/toks-ini.lua index 8fc60335e..0ac5dcc50 100644 --- a/tex/context/base/mkiv/toks-ini.lua +++ b/tex/context/base/mkiv/toks-ini.lua @@ -260,33 +260,65 @@ if setinspector then local simple = { letter = "letter", other_char = "other" } - local function astable(t) - if t and is_token(t) then - local cmdname = t.cmdname - local simple = simple[cmdname] - if simple then - return { - category = simple, - character = utfchar(t.mode) or nil, - } - else - return { - command = t.command, - id = t.id, - tok = t.tok, - csname = t.csname, - active = t.active, - expandable = t.expandable, - protected = t.protected, - frozen = t.frozen, - mode = t.mode, - index = t.index, - user = t.user, - cmdname = cmdname, - } + local astable = CONTEXTLMTXMODE == 0 and + + function(t) + if t and is_token(t) then + local cmdname = t.cmdname + local simple = simple[cmdname] + if simple then + return { + id = t.id, + category = simple, + character = utfchar(t.mode) or nil, + } + else + return { + command = t.command, + id = t.id, + tok = t.tok, + csname = t.csname, + active = t.active, + expandable = t.expandable, + protected = t.protected, + frozen = t.frozen, + mode = t.mode, + index = t.index, + user = t.user, + cmdname = cmdname, + } + end + end + end + + or + + function(t) + if t and is_token(t) then + local cmdname = t.cmdname + local simple = simple[cmdname] + if simple then + return { + id = t.id, + category = simple, + character = utfchar(t.index) or nil, + } + else + return { + id = t.id, + command = t.command, + index = t.index, + csname = t.csname, + cmdname = cmdname, + active = t.active, + expandable = t.expandable, + protected = t.protected, + frozen = t.frozen, + user = t.user, + } + end end end - end tokens.astable = astable -- cgit v1.2.3