summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/luat-cod.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/luat-cod.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/luat-cod.lua64
1 files changed, 7 insertions, 57 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-cod.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-cod.lua
index dcb16c0dd72..91bb7c2e168 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/luat-cod.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/luat-cod.lua
@@ -11,10 +11,6 @@ local match, gsub, find, format, gmatch = string.match, string.gsub, string.find
local texconfig, lua = texconfig, lua
--- maybe pick up from commandline:
---
--- texconfig.interaction: 0=batchmode 1=nonstopmode 2=scrollmode 3=errornonstopmode 4=normal
-
-- some basic housekeeping
texconfig.kpse_init = false
@@ -42,7 +38,7 @@ lua.bytedata = bytedata
lua.bytedone = bytedone
local setbytecode = lua.setbytecode
------ getbytecode = lua.getbytecode
+local getbytecode = lua.getbytecode
lua.firstbytecode = 501
lua.lastbytecode = lua.lastbytecode or (lua.firstbytecode - 1) -- as we load ourselves again ... maybe return earlier
@@ -53,13 +49,9 @@ end
-- no file.* and utilities.parsers.* functions yet
-local strip = false if arg then for i=-1,#arg do if arg[i] == "--c:strip" then strip = true break end end end
-
function lua.registercode(filename,options)
local barename = gsub(filename,"%.[%a%d]+$","")
- if barename == filename then
- filename = filename .. ".lua"
- end
+ if barename == filename then filename = filename .. ".lua" end
local basename = match(barename,"^.+[/\\](.-)$") or barename
if not bytedone[basename] then
local opts = { }
@@ -74,11 +66,7 @@ function lua.registercode(filename,options)
if environment.initex then
local n = lua.lastbytecode + 1
bytedata[n] = { name = barename, options = opts }
- if strip or opts.strip then
- setbytecode(n,code,true)
- else
- setbytecode(n,code)
- end
+ setbytecode(n,code)
lua.lastbytecode = n
end
elseif environment.initex then
@@ -141,18 +129,6 @@ if LUATEXVERION == nil then
+ (tonumber(LUATEXVERSION) or (string.byte(LUATEXVERSION)-string.byte("a")+10))/1000
end
-if CONTEXTLMTXMODE == nil then
- if status.obj_ptr == nil then
- CONTEXTLMTXMODE = 2
- else
- CONTEXTLMTXMODE = 0
- for i=1,#arg do if arg[i] == "--c:lmtx" then
- CONTEXTLMTXMODE, pdf, img = 1, nil, nil
- break
- end end
- end
-end
-
if LUATEXFUNCTIONALITY == nil then
LUATEXFUNCTIONALITY = status.development_id or 6346
end
@@ -167,7 +143,7 @@ end
environment.luatexengine = LUATEXENGINE
environment.luatexversion = LUATEXVERSION
-environment.luatexfunctionality = LUATEXFUNCTIONALITY
+environment.luatexfuncitonality = LUATEXFUNCTIONALITY
environment.jitsupported = JITSUPPORTED
environment.initex = INITEXMODE
environment.initexmode = INITEXMODE
@@ -175,14 +151,12 @@ environment.initexmode = INITEXMODE
if not environment.luafilechunk then
function environment.luafilechunk(filename)
- local fullname = filename
if sourcepath ~= "" then
- fullname = sourcepath .. "/" .. filename
+ filename = sourcepath .. "/" .. filename
end
- local data = loadfile(fullname)
- texio.write("term and log","<",data and "+ " or "- ",fullname,">")
+ local data = loadfile(filename)
+ texio.write("term and log","<",data and "+ " or "- ",filename,">")
if data then
--- package.loaded[gsub(filename,"%..-$"] =
data()
end
return data
@@ -213,21 +187,6 @@ end
-- a kpse error when disabled. This is an engine issue that will
-- be sorted out in due time.
-if not lfs.isfile then
-
- local attributes = lfs.attributes
-
- function lfs.isdir(name)
- return attributes(name,"mode") == "directory"
- end
-
- function lfs.isfile(name)
- local a = attributes(name,"mode")
- return a == "file" or a == "link" or nil
- end
-
-end
-
local isfile = lfs.isfile
local function source_file(name)
@@ -270,15 +229,6 @@ local function open_read_file(name)
}
end
-local function find_data_file(name)
- return source_file(name)
-end
-
-local open_data_file = open_read_file
-
callback.register('find_read_file' , find_read_file )
callback.register('open_read_file' , open_read_file )
callback.register('find_write_file', find_write_file)
-
-callback.register('find_data_file' , find_data_file )
-callback.register('open_data_file' , open_data_file )