summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/meta-pdh.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/meta-pdh.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/meta-pdh.lua25
1 files changed, 16 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/context/base/meta-pdh.lua b/Master/texmf-dist/tex/context/base/meta-pdh.lua
index 05cdfc176d0..117300f8019 100644
--- a/Master/texmf-dist/tex/context/base/meta-pdh.lua
+++ b/Master/texmf-dist/tex/context/base/meta-pdh.lua
@@ -6,6 +6,8 @@ if not modules then modules = { } end modules ['meta-pdf'] = {
license = "see context related readme files"
}
+os.exit()
+
-- This file contains the history of the converter. We keep it around as it
-- relates to the development of luatex.
@@ -27,10 +29,14 @@ local texsprint, ctxcatcodes = tex.sprint, tex.ctxcatcodes
local tostring, tonumber, select = tostring, tonumber, select
local lpegmatch = lpeg.match
-mptopdf = { }
-mptopdf.parsers = { }
-mptopdf.parser = 'none'
-mptopdf.n = 0
+local metapost = metapost
+
+metapost.mptopdf = metapost.mptopdf or { }
+local mptopdf = metapost.mptopdf
+
+mptopdf.parsers = { }
+mptopdf.parser = 'none'
+mptopdf.nofconverted = 0
function mptopdf.reset()
mptopdf.data = ""
@@ -126,9 +132,9 @@ function mptopdf.steps.convert()
mptopdf.data = gsub(mptopdf.data,"%s*([^%a]-)%s*(%a+)", function(args,cmd)
if cmd == "textext" then
t = mptopdf.texts[tonumber(args)]
- return "mps.textext(" .. "\"" .. t[2] .. "\"," .. t[3] .. ",\"" .. t[1] .. "\")\n"
+ return "metapost.mps.textext(" .. "\"" .. t[2] .. "\"," .. t[3] .. ",\"" .. t[1] .. "\")\n"
else
- return "mps." .. cmd .. "(" .. gsub(args," +",",") .. ")\n"
+ return "metapost.mps." .. cmd .. "(" .. gsub(args," +",",") .. ")\n"
end
end)
end
@@ -217,7 +223,7 @@ end
function mptopdf.convertmpstopdf(name)
if mptopdf.loaded(name) then
- mptopdf.n = mptopdf.n + 1
+ mptopdf.nofconverted = mptopdf.nofconverted + 1
statistics.starttiming(mptopdf)
mptopdf.parse()
mptopdf.reset()
@@ -229,7 +235,8 @@ end
-- mp interface
-mps = mps or { }
+metapost.mps = metapost.mps or { }
+local mps = metapost.mps or { }
function mps.creator(a, b, c)
mptopdf.version = tonumber(b)
@@ -593,7 +600,7 @@ mptopdf.parser = 'lpeg'
-- status info
statistics.register("mps conversion time",function()
- local n = mptopdf.n
+ local n = mptopdf.nofconverted
if n > 0 then
return format("%s seconds, %s conversions", statistics.elapsedtime(mptopdf),n)
else