summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/data-pre.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2019-11-25 23:15:50 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2019-11-25 23:15:50 +0100
commit7ecbcaaf68d152851591dbb5931a6eb15d155019 (patch)
tree45722ebceab0911372cd571bfc9b2c1ed992e747 /tex/context/base/mkiv/data-pre.lua
parent8d30ee280d6fb2db6268bf6f839c5f93193a6925 (diff)
downloadcontext-7ecbcaaf68d152851591dbb5931a6eb15d155019.tar.gz
2019-11-25 17:37:00
Diffstat (limited to 'tex/context/base/mkiv/data-pre.lua')
-rw-r--r--tex/context/base/mkiv/data-pre.lua22
1 files changed, 18 insertions, 4 deletions
diff --git a/tex/context/base/mkiv/data-pre.lua b/tex/context/base/mkiv/data-pre.lua
index 5e3020b70..f7df8b918 100644
--- a/tex/context/base/mkiv/data-pre.lua
+++ b/tex/context/base/mkiv/data-pre.lua
@@ -25,6 +25,8 @@ if not modules then modules = { } end modules ['data-pre'] = {
-- version : operating system version
-- release : operating system release
+local insert, remove = table.insert, table.remove
+
local resolvers = resolvers
local prefixes = resolvers.prefixes
@@ -121,8 +123,10 @@ prefixes.path = prefixes.pathname
-- This one assumes that inputstack is set (used in the tex loader). It is a momentary resolve
-- as the top of the input stack changes.
+local inputstack = { }
+local stackpath = resolvers.stackpath
+
local function toppath()
- local inputstack = resolvers.inputstack -- dependency, actually the code should move but it's
if not inputstack then -- more convenient to keep it here
return "."
end
@@ -139,7 +143,7 @@ end
-- stucture.
local function jobpath()
- local path = resolvers.stackpath()
+ local path = stackpath()
if not path or path == "" then
return "."
else
@@ -147,8 +151,18 @@ local function jobpath()
end
end
-resolvers.toppath = toppath
-resolvers.jobpath = jobpath
+local function pushinputname(name)
+ insert(inputstack,name)
+end
+
+local function popinputname(name)
+ return remove(inputstack)
+end
+
+resolvers.toppath = toppath
+resolvers.jobpath = jobpath
+resolvers.pushinputname = pushinputname
+resolvers.popinputname = popinputname
-- This hook sit into the resolver: