diff options
author | Hans Hagen <pragma@wxs.nl> | 2011-04-11 16:45:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2011-04-11 16:45:00 +0200 |
commit | 612f23ed1b01240fdc9ca5132dbd3164e96ed570 (patch) | |
tree | 8eafde3944b1b46eae32e68b240a5eb9cf5f71fc /tex/context/base/attr-neg.lua | |
parent | 0bd8dee4e7e38cfb027bf788505de24aca28261c (diff) | |
download | context-612f23ed1b01240fdc9ca5132dbd3164e96ed570.tar.gz |
beta 2011.04.11 16:45
Diffstat (limited to 'tex/context/base/attr-neg.lua')
-rw-r--r-- | tex/context/base/attr-neg.lua | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/tex/context/base/attr-neg.lua b/tex/context/base/attr-neg.lua index c8f294c71..766295a16 100644 --- a/tex/context/base/attr-neg.lua +++ b/tex/context/base/attr-neg.lua @@ -11,30 +11,34 @@ if not modules then modules = { } end modules ['attr-neg'] = { local format = string.format + local attributes, nodes = attributes, nodes -local states = attributes.states -local tasks = nodes.tasks -local nodeinjections = backends.nodeinjections -local settexattribute = tex.setattribute -local variables = interfaces.variables +local states = attributes.states +local tasks = nodes.tasks +local nodeinjections = backends.nodeinjections +local settexattribute = tex.setattribute +local variables = interfaces.variables +local allocate = utilities.storage.allocate +local setmetatableindex = table.setmetatableindex --- negative / positive -attributes.negatives = attributes.negatives or { } -local negatives = attributes.negatives +attributes.negatives = attributes.negatives or { } +local negatives = attributes.negatives -local a_negative = attributes.private("negative") +local a_negative = attributes.private("negative") -negatives.data = negatives.data or { } -negatives.attribute = a_negative +negatives.data = allocate() +negatives.attribute = a_negative -negatives.registered = { +negatives.registered = allocate { [variables.positive] = 1, [variables.negative] = 2, } -local data, registered = negatives.data, negatives.registered +local data = negatives.data +local registered = negatives.registered local function extender(negatives,key) if key == "none" then @@ -56,8 +60,8 @@ local function reviver(data,n) end end -setmetatable(negatives, { __index = extender }) -setmetatable(negatives.data, { __index = reviver }) +setmetatableindex(negatives, extender) +setmetatableindex(negatives.data, reviver) negatives.handler = nodes.installattributehandler { name = "negative", |