diff options
author | Marius <mariausol@gmail.com> | 2011-09-19 13:40:13 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2011-09-19 13:40:13 +0300 |
commit | 23d49db944011bca3c1b0812fd5f3d354ed33c41 (patch) | |
tree | 4043b2cb16f02555f0728319f4dd1b512aa833dc /tex/context/base/char-ini.lua | |
parent | 4530daff791f4e5e6b9ded048cad042b9e4ec46f (diff) | |
download | context-23d49db944011bca3c1b0812fd5f3d354ed33c41.tar.gz |
beta 2011.09.19 12:37
Diffstat (limited to 'tex/context/base/char-ini.lua')
-rw-r--r-- | tex/context/base/char-ini.lua | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/tex/context/base/char-ini.lua b/tex/context/base/char-ini.lua index 6d17a7507..244b8d2a7 100644 --- a/tex/context/base/char-ini.lua +++ b/tex/context/base/char-ini.lua @@ -109,11 +109,11 @@ setmetatableindex(data, function(t,k) if tk == "string" then k = lpegmatch(pattern,k) or utfbyte(k) if k then - local tk = rawget(t,k) - if tk then - return tk + local v = rawget(t,k) + if v then + return v else - -- goes to ranges + tk = "number" -- fall through to range end else return private @@ -125,10 +125,10 @@ setmetatableindex(data, function(t,k) if k >= rr.first and k <= rr.last then local extender = rr.extender if extender then - v = extender(k,v) + local v = extender(k,v) + t[k] = v + return v end - t[k] = v - return v end end end @@ -743,11 +743,21 @@ setmetatableindex(shchars, function(t,u) if u then local c = data[u] c = c and c setmetatableindex(fschars, function(t,u) if u then local c = data[u] c = c and c.fscode c = c and utfstring(c) or (type(u) == "number" and utfchar(u)) or u t[u] = c return c end end) local decomposed = allocate() characters.decomposed = decomposed -- lazy table +local specials = allocate() characters.specials = specials -- lazy table setmetatableindex(decomposed, function(t,u) -- either a table or false if u then local c = data[u] - local s = c and c.decomposed or false + local s = c and c.decomposed or false -- could fall back to specials + t[u] = s + return s + end +end) + +setmetatableindex(specials, function(t,u) -- either a table or false + if u then + local c = data[u] + local s = c and c.specials or false t[u] = s return s end |