summaryrefslogtreecommitdiff
path: root/tex/context/base/char-ini.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2012-07-17 00:23:00 +0200
committerHans Hagen <pragma@wxs.nl>2012-07-17 00:23:00 +0200
commitcc4b51097349dc33a2364d2ee87ec9b6b87fdcac (patch)
tree0d44624e0c687bc01eaf618e13545591ed2c57bd /tex/context/base/char-ini.lua
parent830b0c94340c7149db68081a90cd1f0fa9705e14 (diff)
downloadcontext-cc4b51097349dc33a2364d2ee87ec9b6b87fdcac.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