diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-04-02 16:25:10 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2018-04-02 16:25:10 +0200 |
commit | 15ab7c153a96a9befc4e2c1774e701f3c941cc2d (patch) | |
tree | 4262a9085036949283dd3e56d992111a9745c680 /tex/context/base/mkiv/util-lua.lua | |
parent | 37c561c2f98d84fc02011b7b819ae8cf9bb4b10d (diff) | |
download | context-15ab7c153a96a9befc4e2c1774e701f3c941cc2d.tar.gz |
2018-04-02 15:51: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 |