summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/toks-ini.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-02-14 16:43:07 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2018-02-14 16:43:07 +0100
commit71e0f049996013abcbfd549b516e594e019fb744 (patch)
treee3197e97a576cbe2e5353e04132a5b28f6d8179e /tex/context/base/mkiv/toks-ini.lua
parente005748401471273a119724acf5e1567f2a04eee (diff)
downloadcontext-71e0f049996013abcbfd549b516e594e019fb744.tar.gz
2018-02-14 16:27:00
Diffstat (limited to 'tex/context/base/mkiv/toks-ini.lua')
-rw-r--r--tex/context/base/mkiv/toks-ini.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/toks-ini.lua b/tex/context/base/mkiv/toks-ini.lua
index a5d511c68..8f95f6692 100644
--- a/tex/context/base/mkiv/toks-ini.lua
+++ b/tex/context/base/mkiv/toks-ini.lua
@@ -16,6 +16,7 @@ local utfchar = utf.char
local char = string.char
local printtable = table.print
local concat = table.concat
+local format = string.format
if setinspector then
@@ -74,8 +75,15 @@ local set_macro = token.set_macro
local get_macro = token.get_macro
local get_meaning = token.get_meaning
local get_cmdname = token.get_cmdname
+local set_char = token.set_char
local create_token = token.create
+if not set_char then -- for a while
+ local contextsprint = context.sprint
+ local ctxcatcodes = catcodes.numbers.ctxcatcodes
+ set_char = function(n,u) contextsprint(ctxcatcodes,format("\\chardef\\%s=%s",n,u)) end
+end
+
function tokens.defined(name)
return get_cmdname(create_token(name)) ~= "undefined_cs"
end
@@ -257,6 +265,7 @@ tokens.getters = { -- these don't expand
tokens.setters = {
macro = set_macro,
+ char = set_char,
count = tex.setcount,
dimen = tex.setdimen,
skip = tex.setglue,