diff options
author | Hans Hagen <pragma@wxs.nl> | 2020-07-29 14:33:33 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2020-07-29 14:33:33 +0200 |
commit | a0ae246b7e860a70cf01c9412c19d2128504d709 (patch) | |
tree | 5bf04e6eae9e1b003f8cd5cbe98356b165d1a9ae /tex/context/base/mkiv/l-package.lua | |
parent | 56ea25ca228844e8b89e0a03a6cbcff1759d4384 (diff) | |
download | context-a0ae246b7e860a70cf01c9412c19d2128504d709.tar.gz |
2020-07-29 14:05:00
Diffstat (limited to 'tex/context/base/mkiv/l-package.lua')
-rw-r--r-- | tex/context/base/mkiv/l-package.lua | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/tex/context/base/mkiv/l-package.lua b/tex/context/base/mkiv/l-package.lua index 0dd71e5ec..94607d436 100644 --- a/tex/context/base/mkiv/l-package.lua +++ b/tex/context/base/mkiv/l-package.lua @@ -54,7 +54,7 @@ local function lualibfile(name) return lpegmatch(pattern,name) or name end -local offset = luarocks and 1 or 0 -- todo: also check other extras +local offset = luarocks and 1 or 0 -- todo: also check other extras ... we'll drop this luarocks anyway local helpers = package.helpers or { cleanpath = cleanpath, @@ -346,19 +346,22 @@ function helpers.loaded(name) level = level + 1 for i=1,#sequence do local method = sequence[i] - if helpers.trace then - helpers.report("%s, level '%s', method '%s', name '%s'","locating",level,method,name) - end - local result, rest = methods[method](name) - if type(result) == "function" then + local lookup = method and methods[method] + if type(lookup) == "function" then if helpers.trace then - helpers.report("%s, level '%s', method '%s', name '%s'","found",level,method,name) + helpers.report("%s, level '%s', method '%s', name '%s'","locating",level,method,name) end - if helpers.traceused then - used[#used+1] = { level = level, name = name } + local result, rest = lookup(name) + if type(result) == "function" then + if helpers.trace then + helpers.report("%s, level '%s', method '%s', name '%s'","found",level,method,name) + end + if helpers.traceused then + used[#used+1] = { level = level, name = name } + end + level = level - 1 + return result, rest end - level = level - 1 - return result, rest end end -- safeguard, we never come here |