summaryrefslogtreecommitdiff
path: root/src/luaotfload-basics-gen.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-05-18 08:50:21 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2014-05-18 08:50:21 +0200
commitd7fc0762b087bcfae22823dc77844db89009a563 (patch)
tree289c9968c13d16ea195a705db1701b62a4731274 /src/luaotfload-basics-gen.lua
parentd435ea827827dcb4494ddff8583e5b15d27625b4 (diff)
downloadluaotfload-d7fc0762b087bcfae22823dc77844db89009a563.tar.gz
[fontloader] sync with Context as of 2014-05-18
Diffstat (limited to 'src/luaotfload-basics-gen.lua')
-rw-r--r--src/luaotfload-basics-gen.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/luaotfload-basics-gen.lua b/src/luaotfload-basics-gen.lua
index 9cf5b93..c19a49a 100644
--- a/src/luaotfload-basics-gen.lua
+++ b/src/luaotfload-basics-gen.lua
@@ -254,6 +254,18 @@ function caches.loaddata(paths,name)
for i=1,#paths do
local data = false
local luaname, lucname = makefullname(paths[i],name)
+ if lucname and not lfs.isfile(lucname) and type(caches.compile) == "function" then
+ -- in case we used luatex and luajittex mixed ... lub or luc file
+ texio.write(string.format("(compiling luc: %s)",lucname))
+ data = loadfile(luaname)
+ if data then
+ data = data()
+ end
+ if data then
+ caches.compile(data,luaname,lucname)
+ return data
+ end
+ end
if lucname and lfs.isfile(lucname) then -- maybe also check for size
texio.write(string.format("(load luc: %s)",lucname))
data = loadfile(lucname)
@@ -341,3 +353,16 @@ end
function table.setmetatableindex(t,f)
setmetatable(t,{ __index = f })
end
+
+-- helper for plain:
+
+arguments = { }
+
+if arg then
+ for i=1,#arg do
+ local k, v = string.match(arg[i],"^%-%-([^=]+)=?(.-)$")
+ if k and v then
+ arguments[k] = v
+ end
+ end
+end