summaryrefslogtreecommitdiff
path: root/tex/context/base/char-utf.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2010-10-10 22:38:43 +0300
committerMarius <mariausol@gmail.com>2010-10-10 22:38:43 +0300
commit16099e33b6d50b37bcddb96e29777a235d2335d7 (patch)
tree724169a7882d1588f8ee4a4511c73fb9b9a232cd /tex/context/base/char-utf.lua
parent2040be98036288cccf0384479819e8c0c17e8d8d (diff)
downloadcontext-16099e33b6d50b37bcddb96e29777a235d2335d7.tar.gz
beta 2010.10.10 14:25
Diffstat (limited to 'tex/context/base/char-utf.lua')
-rw-r--r--tex/context/base/char-utf.lua22
1 files changed, 20 insertions, 2 deletions
diff --git a/tex/context/base/char-utf.lua b/tex/context/base/char-utf.lua
index a0a611e9a..c3549ec01 100644
--- a/tex/context/base/char-utf.lua
+++ b/tex/context/base/char-utf.lua
@@ -35,6 +35,9 @@ local characters = characters
characters.graphemes = allocate()
local graphemes = characters.graphemes
+characters.mathpairs = allocate()
+local mathpairs = characters.mathpairs
+
characters.filters = allocate()
local filters = characters.filters
@@ -54,13 +57,28 @@ local function initialize()
-- using vs and first testing for length is faster (.02->.01 s)
local vs = v.specials
if vs and #vs == 3 and vs[1] == 'char' then
- local first, second = utfchar(vs[2]), utfchar(vs[3])
+ local one, two = vs[2], vs[3]
+ local first, second, combined = utfchar(one), utfchar(two), utfchar(k)
local cgf = graphemes[first]
if not cgf then
cgf = { }
graphemes[first] = cgf
end
- cgf[second] = utfchar(k)
+ cgf[second] = combined
+ if v.mathclass or v.mathspec then
+ local mps = mathpairs[two]
+ if not mps then
+ mps = { }
+ mathpairs[two] = mps
+ end
+ mps[one] = k
+ local mps = mathpairs[second]
+ if not mps then
+ mps = { }
+ mathpairs[second] = mps
+ end
+ mps[first] = combined
+ end
end
end
initialize = false