summaryrefslogtreecommitdiff
path: root/tex/context/base/char-ini.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2012-07-17 13:16:14 +0300
committerMarius <mariausol@gmail.com>2012-07-17 13:16:14 +0300
commitc30a841cef093918b475e0ea95ecf9fc9f30697d (patch)
tree861e4f6cf85f9ad0b0abe5b501a0bac21a6f63ab /tex/context/base/char-ini.lua
parenta13773bf241efe852de82ad42770e2abcc3ddf54 (diff)
downloadcontext-c30a841cef093918b475e0ea95ecf9fc9f30697d.tar.gz
beta 2012.07.17 00:23
Diffstat (limited to 'tex/context/base/char-ini.lua')
-rw-r--r--tex/context/base/char-ini.lua31
1 files changed, 20 insertions, 11 deletions
diff --git a/tex/context/base/char-ini.lua b/tex/context/base/char-ini.lua
index 244b8d2a7..90e36bc7b 100644
--- a/tex/context/base/char-ini.lua
+++ b/tex/context/base/char-ini.lua
@@ -455,28 +455,37 @@ table we derive a few more.</p>
if not characters.fallbacks then
- -- we could the definition by using a metatable
+ characters.fallbacks = { } -- not than many
- characters.fallbacks = { }
- characters.directions = { }
+ local fallbacks = characters.fallbacks
- local fallbacks = characters.fallbacks
- local directions = characters.directions
-
- for k,v in next, data do
- local specials = v.specials
+ for k, d in next, data do
+ local specials = d.specials
if specials and specials[1] == "compat" and specials[2] == 0x0020 and specials[3] then
local s = specials[3]
fallbacks[k] = s
fallbacks[s] = k
end
- directions[k] = v.direction
end
end
-storage.register("characters/fallbacks", characters.fallbacks, "characters.fallbacks") -- accents and such
-storage.register("characters/directions", characters.directions, "characters.directions")
+storage.register("characters/fallbacks", characters.fallbacks, "characters.fallbacks") -- accents and such
+
+characters.directions = { }
+
+setmetatableindex(characters.directions,function(t,k)
+ local d = data[k]
+ if d then
+ local v = d.direction
+ if v then
+ t[k] = v
+ return v
+ end
+ end
+ t[k] = false -- maybe 'l'
+ return v
+end)
--[[ldx--
<p>The <type>context</type> namespace is used to store methods and data