diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-03-22 19:57:53 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2018-03-22 19:57:53 +0100 |
commit | 5c46359f4fa543e24e5d4a0a327d41bf8a9ff7c8 (patch) | |
tree | 79fc6a0e161820ebb16a8830572868dcd0e1aae2 /tex/context/base/mkiv/util-lua.lua | |
parent | f47b4939787074397c9ea37c1d892a1f7ccc7290 (diff) | |
download | context-5c46359f4fa543e24e5d4a0a327d41bf8a9ff7c8.tar.gz |
2018-03-22 19:49:00
Diffstat (limited to 'tex/context/base/mkiv/util-lua.lua')
-rw-r--r-- | tex/context/base/mkiv/util-lua.lua | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/tex/context/base/mkiv/util-lua.lua b/tex/context/base/mkiv/util-lua.lua index bd74d0843..b7de11936 100644 --- a/tex/context/base/mkiv/util-lua.lua +++ b/tex/context/base/mkiv/util-lua.lua @@ -42,7 +42,7 @@ luautilities.suffixes = { -- environment.loadpreprocessedfile can be set to a preprocessor -local function register(name) +local function register(name) -- makes no sense runtime if tracestripping then report_lua("stripped bytecode from %a",name or "unknown") end @@ -75,18 +75,12 @@ end function luautilities.loadedluacode(fullname,forcestrip,name,macros) -- quite subtle ... doing this wrong incidentally can give more bytes name = name or fullname - local code, message if macros then macros = lua.macros end - 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("--[["..fullname.."]] "..c) - if n and #n ~= #c then - report_lua("preprocessed file %a: %i => %i bytes",fullname,#c,#n) - end - code, message = load(n or c) + local code, message + if macros then + code, message = macros.loaded(fullname,true,false) else code, message = loadfile(fullname) end |