summaryrefslogtreecommitdiff
path: root/tex/context/base/trac-lmx.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2012-08-27 18:20:19 +0300
committerMarius <mariausol@gmail.com>2012-08-27 18:20:19 +0300
commit47d1a628ec1cbebf26ac6eeac1cdbdb71009e3fc (patch)
tree03b44a3953c1c3ae1665f96556bc7022a3eb81aa /tex/context/base/trac-lmx.lua
parentef3bfc9ea7ed3326ea07cd48ccf2c3d8d55ea435 (diff)
downloadcontext-47d1a628ec1cbebf26ac6eeac1cdbdb71009e3fc.tar.gz
beta 2012.08.27 17:12
Diffstat (limited to 'tex/context/base/trac-lmx.lua')
-rw-r--r--tex/context/base/trac-lmx.lua18
1 files changed, 16 insertions, 2 deletions
diff --git a/tex/context/base/trac-lmx.lua b/tex/context/base/trac-lmx.lua
index 82b241688..04740d0d5 100644
--- a/tex/context/base/trac-lmx.lua
+++ b/tex/context/base/trac-lmx.lua
@@ -129,7 +129,11 @@ end)
local function loadedfile(name)
name = (resolvers and resolvers.findfile and resolvers.findfile(name)) or name
- return io.loaddata(name)
+ local data = io.loaddata(name)
+ if not data or data == "" then
+ report_lmx("empty file: %s",name)
+ end
+ return data
end
lmx.loadedfile = loadedfile
@@ -448,7 +452,11 @@ local function lmxresult(self,variables)
if self then
local converter = self.converter
if converter then
- return converter(variables)
+ local converted = converter(variables)
+ if trace_variables then -- will become templates
+ report_lmx("converted size: %s",#converted)
+ end
+ return converted
else
return lmxerror("invalid converter")
end
@@ -467,6 +475,9 @@ function lmx.convertstring(templatestring,variables)
end
function lmx.convertfile(templatefile,variables)
+ if trace_variables then -- will become templates
+ report_lmx("converting file: %s",templatefile)
+ end
local converter = loadedfiles[templatefile]
if not converter then
converter = lmxnew(loadedfile(templatefile))
@@ -476,6 +487,9 @@ function lmx.convertfile(templatefile,variables)
end
function lmxconvert(templatefile,resultfile,variables) -- or (templatefile,variables)
+ if trace_variables then -- will become templates
+ report_lmx("converting file: %s",templatefile)
+ end
if not variables and type(resultfile) == "table" then
variables = resultfile
end