summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/luat-env.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-09-12 01:13:39 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2018-09-12 01:13:39 +0200
commit5c433e6e8accaa4bc9ebe0a094b925fe11a8edf5 (patch)
tree7b4b1b7efe2225b4694cc6f7c50707206f8d5b06 /tex/context/base/mkiv/luat-env.lua
parentfd9c4ecd4421d087de21bef1e53d8ffb016285b0 (diff)
downloadcontext-5c433e6e8accaa4bc9ebe0a094b925fe11a8edf5.tar.gz
2018-09-12 00:46:00
Diffstat (limited to 'tex/context/base/mkiv/luat-env.lua')
-rw-r--r--tex/context/base/mkiv/luat-env.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/luat-env.lua b/tex/context/base/mkiv/luat-env.lua
index a01a8cf84..e0c69d207 100644
--- a/tex/context/base/mkiv/luat-env.lua
+++ b/tex/context/base/mkiv/luat-env.lua
@@ -12,6 +12,7 @@
-- code has disappeared already.
local rawset, rawget, loadfile = rawset, rawget, loadfile
+local gsub = string.gsub
local trace_locating = false trackers.register("resolvers.locating", function(v) trace_locating = v end)
@@ -174,3 +175,18 @@ function environment.loadluafile(filename, version)
end
return false
end
+
+environment.filenames = setmetatable( { }, {
+ __index = function(t,k)
+ local v = environment.files[k]
+ if v then
+ return (gsub(v,"%.+$",""))
+ end
+ end,
+ __newindex = function(t,k)
+ -- nothing
+ end,
+ __len = function(t)
+ return #environment.files
+ end,
+} )