diff options
author | Luigi Scarso <luigi.scarso@gmail.com> | 2019-02-22 23:11:47 +0000 |
---|---|---|
committer | Luigi Scarso <luigi.scarso@gmail.com> | 2019-02-22 23:11:47 +0000 |
commit | 5c6357cdb820b4f628d036ba7b2248f221d50c0b (patch) | |
tree | 6365552f2737faaffe63a395272da242ee2c4f03 /Master/texmf-dist/tex/context/base/mkiv/luat-env.lua | |
parent | b4568bc71e054f3d1fd6404b45d2322631778284 (diff) |
ConTeXt version 2019.02.22 19:35
git-svn-id: svn://tug.org/texlive/trunk@50086 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/luat-env.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/luat-env.lua | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-env.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-env.lua index 5b46b403622..e0c69d2079b 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/luat-env.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/luat-env.lua @@ -11,7 +11,8 @@ -- sense. Much of this evolved before bytecode arrays were available and so a lot of -- code has disappeared already. -local rawset, rawget, loadfile, assert = rawset, rawget, loadfile, assert +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) @@ -123,7 +124,7 @@ function environment.loadluafile(filename, version) luaname = file.addsuffix(basename,luasuffixes.lua) lucname = file.addsuffix(basename,luasuffixes.luc) else - luaname = basename -- forced suffix + luaname = filename -- forced suffix lucname = nil end -- when not overloaded by explicit suffix we look for a luc file first @@ -136,7 +137,7 @@ function environment.loadluafile(filename, version) chunk = loadfile(fullname) -- this way we don't need a file exists check end if chunk then - assert(chunk)() + chunk() if version then -- we check of the version number of this chunk matches local v = version -- can be nil @@ -168,9 +169,24 @@ function environment.loadluafile(filename, version) report_lua("unknown file %a",filename) end else - assert(chunk)() + chunk() return true end 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, +} ) |