From fd0c4577a4b6e85ca2db664906e1a03807ce133f Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Sun, 14 May 2017 19:58:50 +0200 Subject: 2017-05-14 19:15:00 --- tex/context/base/mkiv/luat-cod.lua | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'tex/context/base/mkiv/luat-cod.lua') diff --git a/tex/context/base/mkiv/luat-cod.lua b/tex/context/base/mkiv/luat-cod.lua index f62396a8e..31860db78 100644 --- a/tex/context/base/mkiv/luat-cod.lua +++ b/tex/context/base/mkiv/luat-cod.lua @@ -6,7 +6,7 @@ if not modules then modules = { } end modules ['luat-cod'] = { license = "see context related readme files" } -local type, loadfile = type, loadfile +local type, loadfile, tonumber = type, loadfile, tonumber local match, gsub, find, format = string.match, string.gsub, string.find, string.format local texconfig, lua = texconfig, lua @@ -96,7 +96,29 @@ local targetpath = "." -- environment.jobname = tex.jobname -- environment.version = tostring(tex.toks.contextversiontoks) -environment.initex = tex.formatname == "" +if LUATEXVERION == nil then + LUATEXVERSION = status.luatex_version/100 + + tonumber(status.luatex_revision)/1000 +end + +if LUATEXENGINE == nil then + LUATEXENGINE = status.luatex_engine and string.lower(status.luatex_engine) + or (find(status.banner,"LuajitTeX") and "luajittex" or "luatex") +end + +if JITSUPPORTED == nil then + JITSUPPORTED = LUATEXENGINE == "luajittex" or jit +end + +if INITEXMODE == nil then + INITEXMODE = status.ini_version +end + +environment.initex = INITEXMODE +environment.initexmode = INITEXMODE +environment.luatexversion = LUATEXVERSION +environment.luatexengine = LUATEXENGINE +environment.jitsupported = JITSUPPORTED if not environment.luafilechunk then -- cgit v1.2.3