summaryrefslogtreecommitdiff
path: root/src/luaotfload-basics-gen.lua
diff options
context:
space:
mode:
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