summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/data-exp.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-02-09 01:00:38 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2018-02-09 01:00:38 +0100
commitf4c9d2d305f1214a144fcb23a66964761583234a (patch)
treee296f0ac0541d75729af1272346f30506405a6a4 /tex/context/base/mkiv/data-exp.lua
parent1687077b0a63417ad4dce58f6c869a6e115d9b72 (diff)
downloadcontext-f4c9d2d305f1214a144fcb23a66964761583234a.tar.gz
2018-02-09 00:12:00
Diffstat (limited to 'tex/context/base/mkiv/data-exp.lua')
-rw-r--r--tex/context/base/mkiv/data-exp.lua49
1 files changed, 22 insertions, 27 deletions
diff --git a/tex/context/base/mkiv/data-exp.lua b/tex/context/base/mkiv/data-exp.lua
index e34c52efb..173ca9a4d 100644
--- a/tex/context/base/mkiv/data-exp.lua
+++ b/tex/context/base/mkiv/data-exp.lua
@@ -332,6 +332,7 @@ local scancache = { }
local fullcache = { }
----- simplecache = { }
local nofsharedscans = 0
+local addcasecraptoo = true -- experiment to let case matter a bit (still fuzzy)
-- So, we assume either a lowercase name or a mixed case one but only one such case
-- as having Foo fOo foo FoO FOo etc on the system is braindead in any sane project.
@@ -352,11 +353,6 @@ local function scan(files,remap,spec,path,n,m,r,onlyone,tolerant)
if onlyone then
-- forget about it
else
- if type(paths) == "string" then
- files[lower] = { paths, path }
- else
- paths[#paths+1] = path
- end
if name ~= lower then
local rl = remap[lower]
if not rl then
@@ -365,6 +361,21 @@ local function scan(files,remap,spec,path,n,m,r,onlyone,tolerant)
elseif trace_globbing and rl ~= name then
report_globbing("confusing filename, name: %a, lower: %a, already: %a",name,lower,rl)
end
+ if addcasecraptoo then
+ local paths = files[name]
+ if not paths then
+ files[name] = path
+ elseif type(paths) == "string" then
+ files[name] = { paths, path }
+ else
+ paths[#paths+1] = path
+ end
+ end
+ end
+ if type(paths) == "string" then
+ files[lower] = { paths, path }
+ else
+ paths[#paths+1] = path
end
end
else -- probably unique anyway
@@ -490,6 +501,12 @@ function resolvers.get_from_content(content,path,name) -- or (content,name)
else
-- this one does a lookup and resolves a remapped name
local name = path
+ if addcasecraptoo then
+ local path = files[name]
+ if path then
+ return path, name
+ end
+ end
local used = lower(name)
local path = files[used]
if path then
@@ -500,28 +517,6 @@ end
local nothing = function() end
--- function resolvers.filtered_from_content(content,pattern)
--- if content and type(pattern) == "string" then
--- local pattern = lower(pattern)
--- local files = content.files
--- local remap = content.remap
--- if files and remap then
--- local n = next(files)
--- local function iterator()
--- while n do
--- local k = n
--- n = next(files,k)
--- if find(k,pattern) then
--- return files[k], remap and remap[k] or k
--- end
--- end
--- end
--- return iterator
--- end
--- end
--- return nothing
--- end
-
function resolvers.filtered_from_content(content,pattern)
if content and type(pattern) == "string" then
local pattern = lower(pattern)