summaryrefslogtreecommitdiff
path: root/tex/context/base/math-vfu.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2011-04-11 18:00:19 +0300
committerMarius <mariausol@gmail.com>2011-04-11 18:00:19 +0300
commitdbbbbfac3d158709a07af8c26e68284d1b0ea202 (patch)
treeb9cb25022fc2858c0dcbc190ad466ba89c69861d /tex/context/base/math-vfu.lua
parent7c7fe9c9e18355f42d0dba1b248235252728060b (diff)
downloadcontext-dbbbbfac3d158709a07af8c26e68284d1b0ea202.tar.gz
beta 2011.04.11 16:45
Diffstat (limited to 'tex/context/base/math-vfu.lua')
-rw-r--r--tex/context/base/math-vfu.lua31
1 files changed, 16 insertions, 15 deletions
diff --git a/tex/context/base/math-vfu.lua b/tex/context/base/math-vfu.lua
index 190a89c71..afb4c1be2 100644
--- a/tex/context/base/math-vfu.lua
+++ b/tex/context/base/math-vfu.lua
@@ -13,23 +13,24 @@ if not modules then modules = { } end modules ['math-vfu'] = {
local type, next = type, next
local max = math.max
+local fonts, nodes, mathematics = fonts, nodes, mathematics
+
local trace_virtual = false trackers.register("math.virtual", function(v) trace_virtual = v end)
local trace_timings = false trackers.register("math.timings", function(v) trace_timings = v end)
-local report_virtual = logs.reporter("fonts","virtual math")
-
-local fonts, nodes, mathematics = fonts, nodes, mathematics
+local report_virtual = logs.reporter("fonts","virtual math")
-local allocate = utilities.storage.allocate
+local allocate = utilities.storage.allocate
+local setmetatableindex = table.setmetatableindex
-local mathencodings = allocate()
-fonts.encodings.math = mathencodings -- better is then: fonts.encodings.vectors
-local vfmath = allocate()
-fonts.handlers.vf.math = vfmath
+local mathencodings = allocate()
+fonts.encodings.math = mathencodings -- better is then: fonts.encodings.vectors
+local vfmath = allocate()
+fonts.handlers.vf.math = vfmath
-vfmath.optional = false
+vfmath.optional = false
-local shared = { }
+local shared = { }
--~ local push, pop, back = { "push" }, { "pop" }, { "slot", 1, 0x2215 }
@@ -346,7 +347,7 @@ local unique = 0 -- testcase: \startTEXpage \math{!\text{-}\text{-}\text{-}} \st
local reported = { }
local reverse = { } -- index -> unicode
-setmetatable ( reverse, { __index = function(t,name)
+setmetatableindex(reverse, function(t,name)
if trace_virtual then
report_virtual("initializing math vector '%s'",name)
end
@@ -356,7 +357,7 @@ setmetatable ( reverse, { __index = function(t,name)
end
reverse[name] = r
return r
-end } )
+end)
function vfmath.define(specification,set,goodies)
local name = specification.name -- symbolic name
@@ -460,14 +461,14 @@ function vfmath.define(specification,set,goodies)
end
--
local description = { name = "<unset>" }
- setmetatable(descriptions, { __index = function() return description end })
+ setmetatableindex(descriptions,function() return description end)
--
if parent.properties then
- setmetatable(properties, { __index = parent.properties })
+ setmetatableindex(properties,parent.properties)
end
--
if parent.goodies then
- setmetatable(goodies, { __index = parent.goodies })
+ setmetatableindex(goodies,parent.goodies)
end
--
properties.virtualized = true