diff options
author | Taco Hoekwater <taco@elvenkind.com> | 2008-06-12 10:42:53 +0000 |
---|---|---|
committer | Taco Hoekwater <taco@elvenkind.com> | 2008-06-12 10:42:53 +0000 |
commit | 0d01365d53c456d246da0ca1f0b3cd9868f02b35 (patch) | |
tree | 01a655c8028e17cfb371456b299c1848fe08c05b /Master/texmf-dist/tex/context/base/luat-tre.lua | |
parent | 44f3714442da07fdfc36a7f2a8dcd5d4294c5d26 (diff) |
ConTeXt release 2008.05.21
git-svn-id: svn://tug.org/texlive/trunk@8691 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/luat-tre.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/luat-tre.lua | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/luat-tre.lua b/Master/texmf-dist/tex/context/base/luat-tre.lua new file mode 100644 index 00000000000..e749a5b330a --- /dev/null +++ b/Master/texmf-dist/tex/context/base/luat-tre.lua @@ -0,0 +1,45 @@ +-- filename : luat-tre.lua +-- comment : companion to luat-lib.tex +-- author : Hans Hagen, PRAGMA-ADE, Hasselt NL +-- copyright: PRAGMA ADE / ConTeXt Development Team +-- license : see context related readme files + +if not versions then versions = { } end versions['luat-tre'] = 1.001 + +-- \input tree://oeps1/**/oeps.tex + +do + + local done, found = { }, { } + + function input.finders.tree(instance,specification,filetype) + local fnd = found[specification] + if not fnd then + local spec = input.splitmethod(specification).path or "" + if spec ~= "" then + local path, name = file.dirname(spec), file.basename(spec) + if path == "" then path = "." end + local hash = done[path] + if not hash then + local pattern = path .. "/*" -- we will use the proper splitter + hash = dir.glob(pattern) + done[path] = hash + end + local pattern = "/" .. name:gsub("([%.%-%+])", "%%%1") .. "$" + for k, v in pairs(hash) do + if v:find(pattern) then + found[specification] = v + return v + end + end + end + fnd = unpack(input.finders.notfound) + found[specification] = fnd + end + return fnd + end + + input.openers.tree = input.openers.generic + input.loaders.tree = input.loaders.generic + +end |