summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/data-vir.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/data-vir.lua')
-rw-r--r--tex/context/base/mkiv/data-vir.lua23
1 files changed, 16 insertions, 7 deletions
diff --git a/tex/context/base/mkiv/data-vir.lua b/tex/context/base/mkiv/data-vir.lua
index 5a96a1d21..4b19ee537 100644
--- a/tex/context/base/mkiv/data-vir.lua
+++ b/tex/context/base/mkiv/data-vir.lua
@@ -7,7 +7,7 @@ if not modules then modules = { } end modules ['data-vir'] = {
}
local type = type
-local formatters, validstrings = string.formatters, string.valid
+local formatters = string.formatters
local trace_virtual = false
local report_virtual = logs.reporter("resolvers","virtual")
@@ -16,8 +16,7 @@ trackers.register("resolvers.locating", function(v) trace_virtual = v end)
trackers.register("resolvers.virtual", function(v) trace_virtual = v end)
local resolvers = resolvers
-
-local finders, openers, loaders, savers = resolvers.finders, resolvers.openers, resolvers.loaders, resolvers.savers
+local savers = resolvers.savers
local data = { }
local n = 0 -- hm, number can be query
@@ -38,6 +37,9 @@ function savers.virtual(specification,content,suffix)
return filename
end
+local finders = resolvers.finders
+local notfound = finders.notfound
+
function finders.virtual(specification)
local original = specification.original
local d = data[original]
@@ -50,10 +52,14 @@ function finders.virtual(specification)
if trace_virtual then
report_virtual("finder: unknown file %a",original)
end
- return finders.notfound()
+ return notfound()
end
end
+local openers = resolvers.openers
+local notfound = openers.notfound
+local textopener = openers.helpers.textopener
+
function openers.virtual(specification)
local original = specification.original
local d = data[original]
@@ -64,15 +70,18 @@ function openers.virtual(specification)
data[original] = nil -- when we comment this we can have error messages
-- With utf-8 we signal that no regime is to be applied!
-- characters.showstring(d)
- return openers.helpers.textopener("virtual",original,d,"utf-8")
+ return textopener("virtual",original,d,"utf-8")
else
if trace_virtual then
report_virtual("opener: file %a not found",original)
end
- return openers.notfound()
+ return notfound()
end
end
+local loaders = resolvers.loaders
+local notfound = loaders.notfound
+
function loaders.virtual(specification)
local original = specification.original
local d = data[original]
@@ -86,5 +95,5 @@ function loaders.virtual(specification)
if trace_virtual then
report_virtual("loader: file %a not loaded",original)
end
- return loaders.notfound()
+ return notfound()
end