summaryrefslogtreecommitdiff
path: root/tex/context/base/strc-syn.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2010-09-03 12:35:26 +0300
committerMarius <mariausol@gmail.com>2010-09-03 12:35:26 +0300
commit16895587e51f8243a7e4dc6185979894fb199d4f (patch)
tree923fe9fe4d34a11202e06a4258ba71bab6ccde8d /tex/context/base/strc-syn.lua
parent20da4ce347921be291c8804041bd8756e3bf1707 (diff)
downloadcontext-16895587e51f8243a7e4dc6185979894fb199d4f.tar.gz
beta 2010.09.03 11:05
Diffstat (limited to 'tex/context/base/strc-syn.lua')
-rw-r--r--tex/context/base/strc-syn.lua18
1 files changed, 9 insertions, 9 deletions
diff --git a/tex/context/base/strc-syn.lua b/tex/context/base/strc-syn.lua
index fed5bf58c..005036843 100644
--- a/tex/context/base/strc-syn.lua
+++ b/tex/context/base/strc-syn.lua
@@ -8,23 +8,23 @@ if not modules then modules = { } end modules ['str-syn'] = {
local next, type = next, type
local texwrite, texsprint, format = tex.write, tex.sprint, string.format
+local allocate, mark = utilities.storage.allocate, utilities.storage.mark
local ctxcatcodes = tex.ctxcatcodes
-- interface to tex end
local structures = structures
-
-structures.synonyms = structures.synonyms or { }
local synonyms = structures.synonyms
-synonyms.collected = synonyms.collected or { }
-synonyms.tobesaved = synonyms.tobesaved or { }
+local collected, tobesaved = allocate(), allocate()
-local collected, tobesaved = synonyms.collected, synonyms.tobesaved
+synonyms.collected = collected
+synonyms.tobesaved = tobesaved
local function initializer()
- collected, tobesaved = synonyms.collected, synonyms.tobesaved
+ collected = mark(synonyms.collected)
+ tobesaved = mark(synonyms.tobesaved)
end
local function finalizer()
@@ -33,7 +33,7 @@ local function finalizer()
end
end
-job.register('structures.synonyms.collected', synonyms.tobesaved, initializer, finalizer)
+job.register('structures.synonyms.collected', tobesaved, initializer, finalizer)
local function allocate(class)
local d = tobesaved[class]
@@ -171,7 +171,7 @@ function synonyms.flush(data,options) -- maybe pass the settings differently
data.metadata.sorted = false
end
-function synonyms.analysed(class,options)
+function synonyms.analyzed(class,options)
local data = synonyms.collected[class]
if data and data.entries then
options = options or { }
@@ -186,7 +186,7 @@ function synonyms.analysed(class,options)
end
function synonyms.process(class,options)
- if synonyms.analysed(class,options) then
+ if synonyms.analyzed(class,options) then
synonyms.flush(synonyms.collected[class],options)
end
end