summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/luat-cod.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-05-14 19:58:50 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-05-14 19:58:50 +0200
commitfd0c4577a4b6e85ca2db664906e1a03807ce133f (patch)
treefa23fcc04248d03ff82e34634b8ef1bb9cf28acb /tex/context/base/mkiv/luat-cod.lua
parentdb581096187dc2d3cbdbe4cdc39d247c168b1607 (diff)
downloadcontext-fd0c4577a4b6e85ca2db664906e1a03807ce133f.tar.gz
2017-05-14 19:15:00
Diffstat (limited to 'tex/context/base/mkiv/luat-cod.lua')
-rw-r--r--tex/context/base/mkiv/luat-cod.lua26
1 files changed, 24 insertions, 2 deletions
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