summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/mlib-run.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2019-06-12 00:08:48 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2019-06-12 00:08:48 +0200
commit36ee3b791e253a00877a7b25e2d94b1dfc90a174 (patch)
tree51cddb18e68861f7ccbf6069e047fe0d3972961f /tex/context/base/mkiv/mlib-run.lua
parente8dc7842e52c4509ce38115c521672198beafca3 (diff)
downloadcontext-36ee3b791e253a00877a7b25e2d94b1dfc90a174.tar.gz
2019-06-11 19:28:00
Diffstat (limited to 'tex/context/base/mkiv/mlib-run.lua')
-rw-r--r--tex/context/base/mkiv/mlib-run.lua13
1 files changed, 10 insertions, 3 deletions
diff --git a/tex/context/base/mkiv/mlib-run.lua b/tex/context/base/mkiv/mlib-run.lua
index 3365e3d42..bd4818659 100644
--- a/tex/context/base/mkiv/mlib-run.lua
+++ b/tex/context/base/mkiv/mlib-run.lua
@@ -288,6 +288,11 @@ metapost.defaultmethod = "default"
local mpxformats = { }
local nofformats = 0
local mpxpreambles = { }
+local mpxextradata = { }
+
+function metapost.getextradata(mpx)
+ return mpxextradata[mpx]
+end
function metapost.pushformat(specification,f,m) -- was: instance, name, method
if type(specification) ~= "table" then
@@ -338,6 +343,7 @@ function metapost.pushformat(specification,f,m) -- was: instance, name, method
report_metapost("initializing instance %a using format %a and method %a",usedinstance,format,method)
mpx = metapost.checkformat(format,method)
mpxformats[usedinstance] = mpx
+ mpxextradata[mpx] = { }
if mpp ~= "" then
preamble = mpp
end
@@ -349,7 +355,6 @@ function metapost.pushformat(specification,f,m) -- was: instance, name, method
return mpx
end
-
-- luatex.wrapup(function()
-- for k, mpx in next, mpxformats do
-- mpx:finish()
@@ -365,14 +370,16 @@ function metapost.reset(mpx)
-- nothing
elseif type(mpx) == "string" then
if mpxformats[mpx] then
- mpxformats[mpx]:finish()
+ mpxextradata[mpx] = nil
mpxformats[mpx] = nil
+ mpxformats[mpx]:finish()
end
else
for name, instance in next, mpxformats do
if instance == mpx then
+ mpxextradata[mpx] = nil
+ mpxformats[mpx] = nil
mpx:finish()
- mpxformats[name] = nil
break
end
end