diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-11-07 12:49:36 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-11-07 12:49:36 +0100 |
commit | 75fbb107b15d01179a4b772844144e0661240e77 (patch) | |
tree | c5210f4f9ade25c89a540f755912a52966404792 /tex/context/base/mkiv/util-lua.lua | |
parent | 7830451577b876020de2a26bbfbf069625ab4d6f (diff) | |
download | context-75fbb107b15d01179a4b772844144e0661240e77.tar.gz |
2017-11-07 11:43:00
Diffstat (limited to 'tex/context/base/mkiv/util-lua.lua')
-rw-r--r-- | tex/context/base/mkiv/util-lua.lua | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tex/context/base/mkiv/util-lua.lua b/tex/context/base/mkiv/util-lua.lua index 1c25bcc03..bd74d0843 100644 --- a/tex/context/base/mkiv/util-lua.lua +++ b/tex/context/base/mkiv/util-lua.lua @@ -82,7 +82,7 @@ function luautilities.loadedluacode(fullname,forcestrip,name,macros) if macros and macros.enabled then -- local c = io.loaddata(fullname) -- not yet available local f = io.open(fullname,"rb") local c = f:read("*a") f:close() - local n = c and macros.resolvestring(c) + local n = c and macros.resolvestring("--[["..fullname.."]] "..c) if n and #n ~= #c then report_lua("preprocessed file %a: %i => %i bytes",fullname,#c,#n) end @@ -113,7 +113,7 @@ function luautilities.loadedluacode(fullname,forcestrip,name,macros) end end -function luautilities.strippedloadstring(code,forcestrip,name) -- not executed +function luautilities.strippedloadstring(code,name,forcestrip) -- not executed local code, message = load(code) if not code then report_lua("loading of file %a failed:\n\t%s",name,message or "no message") @@ -126,6 +126,14 @@ function luautilities.strippedloadstring(code,forcestrip,name) -- not executed end end +function luautilities.loadstring(code,name) -- not executed + local code, message = load(code) + if not code then + report_lua("loading of file %a failed:\n\t%s",name,message or "no message") + end + return code, 0 +end + function luautilities.compile(luafile,lucfile,cleanup,strip,fallback) -- defaults: cleanup=false strip=true report_lua("compiling %a into %a",luafile,lucfile) os.remove(lucfile) |