summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/char-tex.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/char-tex.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/char-tex.lua33
1 files changed, 10 insertions, 23 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/char-tex.lua b/Master/texmf-dist/tex/context/base/mkiv/char-tex.lua
index bbaf11875d0..065152881d6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/char-tex.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/char-tex.lua
@@ -8,7 +8,7 @@ if not modules then modules = { } end modules ['char-tex'] = {
local lpeg = lpeg
local tonumber, next, type = tonumber, next, type
-local format, find, gmatch, match = string.format, string.find, string.gmatch, string.match
+local format, find, gmatch = string.format, string.find, string.gmatch
local utfchar, utfbyte = utf.char, utf.byte
local concat, tohash = table.concat, table.tohash
local P, C, R, S, V, Cs, Cc = lpeg.P, lpeg.C, lpeg.R, lpeg.S, lpeg.V, lpeg.Cs, lpeg.Cc
@@ -462,24 +462,16 @@ function commands.makeactive(n,name) -- not used
-- context("\\catcode%s=13\\unexpanded\\def %s{\\%s}",n,utfchar(n),name)
end
-local function to_number(s)
- local n = tonumber(s)
- if n then
- return n
- end
- return tonumber(match(s,'^"(.*)$'),16) or 0
-end
-
implement {
name = "utfchar",
- actions = { to_number, utfchar, contextsprint },
- arguments = "string"
+ actions = { utfchar, contextsprint },
+ arguments = "integer"
}
implement {
name = "safechar",
- actions = { to_number, texcharacters.safechar, contextsprint },
- arguments = "string"
+ actions = { texcharacters.safechar, contextsprint },
+ arguments = "integer"
}
implement {
@@ -600,17 +592,14 @@ if not csletters then
end
--
if isletter then
- local lc = chr.lccode
- local uc = chr.uccode
+ local lc, uc = chr.lccode, chr.uccode
if not lc then
- chr.lccode = u
- lc = u
+ chr.lccode, lc = u, u
elseif type(lc) == "table" then
lc = u
end
if not uc then
- chr.uccode = u
- uc = u
+ chr.uccode, uc = u, u
elseif type(uc) == "table" then
uc = u
end
@@ -634,14 +623,12 @@ if not csletters then
--
local lc, uc = chr.lccode, chr.uccode
if not lc then
- chr.lccode = u
- lc = u
+ chr.lccode, lc = u, u
elseif type(lc) == "table" then
lc = u
end
if not uc then
- chr.uccode = u
- uc = u
+ chr.uccode, uc = u, u
elseif type(uc) == "table" then
uc = u
end