diff options
Diffstat (limited to 'tex/context/base/attr-eff.lua')
-rw-r--r-- | tex/context/base/attr-eff.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tex/context/base/attr-eff.lua b/tex/context/base/attr-eff.lua index 4759ad1fa..53610cbff 100644 --- a/tex/context/base/attr-eff.lua +++ b/tex/context/base/attr-eff.lua @@ -8,6 +8,8 @@ if not modules then modules = { } end modules ['attr-eff'] = { local format = string.format +local allocate = utilities.storage.allocate + local attributes, nodes = attributes, nodes local states = attributes.states @@ -16,15 +18,16 @@ local nodeinjections = backends.nodeinjections attributes.effects = attributes.effects or { } local effects = attributes.effects -effects.data = effects.data or { } +effects.data = allocate() effects.values = effects.values or { } effects.registered = effects.registered or { } -effects.stamp = "%s:%s:%s" effects.attribute = attributes.private("effect") storage.register("attributes/effects/registered", effects.registered, "attributes.effects.registered") storage.register("attributes/effects/values", effects.values, "attributes.effects.values") +local template = "%s:%s:%s" + local data, registered, values = effects.data, effects.registered, effects.values -- valid effects: normal inner outer both hidden (stretch,rulethickness,effect) @@ -50,7 +53,7 @@ setmetatable(effects, { __index = extender }) setmetatable(effects.data, { __index = reviver }) function effects.register(effect,stretch,rulethickness) - local stamp = format(effects.stamp,effect,stretch,rulethickness) + local stamp = format(template,effect,stretch,rulethickness) local n = registered[stamp] if not n then n = #values + 1 |