diff options
author | Hans Hagen <pragma@wxs.nl> | 2021-03-05 12:17:06 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2021-03-05 12:17:06 +0100 |
commit | cd05787a9d41bac345695564011d333974afe1d9 (patch) | |
tree | ecc998d3de192ddcccdf1fcb1ec56fc3d539c2f9 /tex/context/base/mkiv | |
parent | 0d300509bdd7497fd376844b2326f5917636590e (diff) | |
download | context-cd05787a9d41bac345695564011d333974afe1d9.tar.gz |
2021-03-05 11:16:00
Diffstat (limited to 'tex/context/base/mkiv')
-rw-r--r-- | tex/context/base/mkiv/back-exp.lua | 4 | ||||
-rw-r--r-- | tex/context/base/mkiv/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/core-con.mkiv | 9 | ||||
-rw-r--r-- | tex/context/base/mkiv/l-package.lua | 22 | ||||
-rw-r--r-- | tex/context/base/mkiv/luat-log.lua | 4 | ||||
-rw-r--r-- | tex/context/base/mkiv/mult-fmt.lua | 34 | ||||
-rw-r--r-- | tex/context/base/mkiv/page-ini.lua | 17 | ||||
-rw-r--r-- | tex/context/base/mkiv/status-files.pdf | bin | 25371 -> 25388 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/status-lua.pdf | bin | 256137 -> 257036 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/strc-pag.lua | 1 | ||||
-rw-r--r-- | tex/context/base/mkiv/typo-bld.lua | 77 | ||||
-rw-r--r-- | tex/context/base/mkiv/util-lib.lua | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/util-soc-imp-http.lua | 10 |
14 files changed, 92 insertions, 92 deletions
diff --git a/tex/context/base/mkiv/back-exp.lua b/tex/context/base/mkiv/back-exp.lua index 700c1f040..7a37cc948 100644 --- a/tex/context/base/mkiv/back-exp.lua +++ b/tex/context/base/mkiv/back-exp.lua @@ -2145,9 +2145,7 @@ do function structurestags.setparagraph(align) if align ~= "" then usedparagraphs[locatedtag("paragraph")] = { - dataset = dataset, - tag = tag, - align = align, + align = align, } end end diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index cea147adc..f12dfde45 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2021.03.02 19:17} +\newcontextversion{2021.03.05 11:13} %D This file is loaded at runtime, thereby providing an excellent place for hacks, %D patches, extensions and new features. There can be local overloads in cont-loc diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index abbe41be2..c149869df 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -45,7 +45,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2021.03.02 19:17} +\edef\contextversion{2021.03.05 11:13} %D Kind of special: diff --git a/tex/context/base/mkiv/core-con.mkiv b/tex/context/base/mkiv/core-con.mkiv index 953a99395..616ed1996 100644 --- a/tex/context/base/mkiv/core-con.mkiv +++ b/tex/context/base/mkiv/core-con.mkiv @@ -467,11 +467,14 @@ \letdummyparameter\c!m\normalmonth \letdummyparameter\c!y\normalyear \getdummyparameters[#1]% + \edef\p_d{\directdummyparameter\c!d}% + \edef\p_m{\directdummyparameter\c!m}% + \edef\p_y{\directdummyparameter\c!y}% \normalexpanded {\endgroup - \normalday \number\directdummyparameter\c!d\relax - \normalmonth\number\directdummyparameter\c!m\relax - \normalyear \number\directdummyparameter\c!y\relax}% + \ifx\p_d\empty\else\normalday \number\directdummyparameter\c!d\relax\fi + \ifx\p_m\empty\else\normalmonth\number\directdummyparameter\c!m\relax\fi + \ifx\p_y\empty\else\normalyear \number\directdummyparameter\c!y\relax\fi}% \fi \begingroup \the\everycurrentdate diff --git a/tex/context/base/mkiv/l-package.lua b/tex/context/base/mkiv/l-package.lua index a35ec3e2a..ef37aebe7 100644 --- a/tex/context/base/mkiv/l-package.lua +++ b/tex/context/base/mkiv/l-package.lua @@ -16,7 +16,7 @@ if not modules then modules = { } end modules ['l-package'] = { -- -- local mylib = require("libtest") -- -- local mysql = require("luasql.mysql") -local type = type +local type, unpack = type, unpack local gsub, format, find = string.gsub, string.format, string.find local insert, remove = table.insert, table.remove @@ -70,6 +70,7 @@ local helpers = package.helpers or { methods = { }, sequence = { + "reset loaded", "already loaded", "preload table", "qualified path", -- beware, lua itself doesn't handle qualified paths (prepends ./) @@ -91,6 +92,7 @@ local builtin = helpers.builtin local extraluapaths = { } local extralibpaths = { } +local checkedfiles = { } local luapaths = nil -- delayed local libpaths = nil -- delayed local oldluapath = nil @@ -245,10 +247,17 @@ local function loadedaslib(resolved,rawname) -- todo: strip all before first - -- so, we can do a require("foo/bar") and initialize bar -- local base = gsub(file.basename(rawname),"%.","_") local init = "luaopen_" .. gsub(base,"%.","_") + local data = { resolved, init, "" } + checkedfiles[#checkedfiles+1] = data if helpers.trace then helpers.report("calling loadlib with '%s' with init '%s'",resolved,init) end - return package.loadlib(resolved,init) + local a, b, c = package.loadlib(resolved,init) + if not a and type(b) == "string" then +-- data[3] = gsub(b or "unknown error","[\n\r]","") + data[3] = string.fullstrip(b or "unknown error") + end + return a, b, c -- c can be 'init' end helpers.loadedaslib = loadedaslib @@ -295,6 +304,12 @@ end helpers.loadedbyname = loadedbyname +methods["reset loaded"] = function(name) + checkedfiles = { } + return false +end + + methods["already loaded"] = function(name) return package.loaded[name] end @@ -344,6 +359,9 @@ end methods["not loaded"] = function(name) if helpers.trace then helpers.report("unable to locate '%s'",name or "?") + for i=1,#checkedfiles do + helpers.report("checked file '%s', initializer '%s', message '%s'",unpack(checkedfiles[i])) + end end return nil end diff --git a/tex/context/base/mkiv/luat-log.lua b/tex/context/base/mkiv/luat-log.lua index fd3b73d3d..8bfec8d21 100644 --- a/tex/context/base/mkiv/luat-log.lua +++ b/tex/context/base/mkiv/luat-log.lua @@ -716,7 +716,7 @@ do if s then report("start %s: %s",what,s) else - report("start %s",what) + report("start %s",what or "") end if target == "logfile" then newline() @@ -728,7 +728,7 @@ do if target == "logfile" then newline() end - report("stop %s",what) + report("stop %s",what or "") if target == "logfile" then newline() end diff --git a/tex/context/base/mkiv/mult-fmt.lua b/tex/context/base/mkiv/mult-fmt.lua index 53dbff5b8..0d11a4253 100644 --- a/tex/context/base/mkiv/mult-fmt.lua +++ b/tex/context/base/mkiv/mult-fmt.lua @@ -271,24 +271,24 @@ function interfaces.setuserinterface(interface,response) -- end -- end) -- end -do - local list = complete.commands -- forces the load - local t = { } - local n = 0 - local f = formatters["\\frozen\\protected\\def\\%s{\\%s}"] -- formatters["\\ui_m{%s}{%s}"] - logs.startfilelogging(report,"translated commands") - for given, command in sortedhash(list) do - command = command[interface] or command.en or given - if command ~= given then - n = n + 1 - t[n] = f(command,given) - report_command("%-40s: %s",given,command) + do + local list = complete.commands -- forces the load + local t = { } + local n = 0 + local f = formatters["\\frozen\\protected\\def\\%s{\\%s}"] -- formatters["\\ui_m{%s}{%s}"] + logs.startfilelogging(report,"translated commands") + for given, command in sortedhash(list) do + command = command[interface] or command.en or given + if command ~= given then + n = n + 1 + t[n] = f(command,given) + report_command("%-40s: %s",given,command) + end + nofcommands = nofcommands + 1 + end + logs.stopfilelogging() + contextsprint(prtcatcodes,"\\toksapp\\everydump{"..concat(t).."}") end - nofcommands = nofcommands + 1 - end - logs.stopfilelogging() - contextsprint(prtcatcodes,"\\toksapp\\everydump{"..concat(t).."}") -end do local list = complete.messages.formats logs.startfilelogging(report,"translated message formats") diff --git a/tex/context/base/mkiv/page-ini.lua b/tex/context/base/mkiv/page-ini.lua index 17f4c44da..924e01b2a 100644 --- a/tex/context/base/mkiv/page-ini.lua +++ b/tex/context/base/mkiv/page-ini.lua @@ -8,7 +8,7 @@ if not modules then modules = { } end modules ['page-ini'] = { local tonumber, rawget, rawset, type, next = tonumber, rawget, rawset, type, next local match = string.match -local sort, tohash, insert, remove = table.sort, table.tohash, table.insert, table.remove +local sort, tohash, insert, remove, sortedkeys = table.sort, table.tohash, table.insert, table.remove, table.sortedkeys local settings_to_array, settings_to_hash = utilities.parsers.settings_to_array, utilities.parsers.settings_to_hash local texgetcount = tex.getcount @@ -87,10 +87,23 @@ function pages.mark(name,list) end end +local tobemarked = { } + +function pages.markedlist(realpage) + if realpage then + local m = rawget(tobemarked,realpage) or rawget(data,realpage) + return m and next(m) and sortedkeys(m) + end +end + local function marked(name) local realpage = texgetcount("realpageno") for i=last,realpage-1 do - rawset(data,i,nil) + local di = data[i] + if di then + tobemarked[i] = di + rawset(data,i,nil) + end end local pagedata = rawget(data,realpage) return pagedata and pagedata[name] and true or false diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex 4747b2d13..eccdf2ee0 100644 --- a/tex/context/base/mkiv/status-files.pdf +++ b/tex/context/base/mkiv/status-files.pdf diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf Binary files differindex 021bcf069..4ccd668fc 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkiv/strc-pag.lua b/tex/context/base/mkiv/strc-pag.lua index 6f9cdd429..9c040104d 100644 --- a/tex/context/base/mkiv/strc-pag.lua +++ b/tex/context/base/mkiv/strc-pag.lua @@ -84,6 +84,7 @@ function pages.save(prefixdata,numberdata,extradata) block = sections.currentblock(), prefixdata = prefixdata and helpers.simplify(prefixdata), numberdata = numberdata and helpers.simplify(numberdata), + marked = pages.markedlist(realpage), -- not yet defined } tobesaved[realpage] = data if not collected[realpage] then diff --git a/tex/context/base/mkiv/typo-bld.lua b/tex/context/base/mkiv/typo-bld.lua index 269386e6c..305032772 100644 --- a/tex/context/base/mkiv/typo-bld.lua +++ b/tex/context/base/mkiv/typo-bld.lua @@ -242,65 +242,30 @@ end -- this will be split into contribute_filter for these 4 so at some point -- the check can go away -if CONTEXTLMTXMODE > 0 then - - -- Todo: contrib_head can be any head (kind of) not per se the page one so maybe I will - -- intercept that in the engine with page_contribute_head or so. - - function builders.buildpage_filter(groupcode) - local head = texlists.contribute_head - if head then - local done = false - -- called quite often ... maybe time to remove timing - starttiming(builders) - if trace_page_builder then - report(groupcode,head) - end - head, done = pageactions(head,groupcode) - stoptiming(builders) - -- -- doesn't work here (not passed on?) - -- texset("pagegoal,texget("vsize") - texgetdimen("d_page_floats_inserted_top") - texgetdimen("d_page_floats_inserted_bottom") - texlists.contribute_head = head or nil -- needs checking - -- tex.setlist("contribute_head",head,head and nodes.tail(head)) - return done and head or true -- no return value needed - else - -- happens quite often - if trace_page_builder then - report(groupcode) - end - -- return nil, false -- no return value needed - return nil +function builders.buildpage_filter(groupcode) + local head = texlists.contrib_head + if head then + local done = false + -- called quite often ... maybe time to remove timing + starttiming(builders) + if trace_page_builder then + report(groupcode,head) end - end - -else - - function builders.buildpage_filter(groupcode) - local head = texlists.contrib_head - if head then - local done = false - -- called quite often ... maybe time to remove timing - starttiming(builders) - if trace_page_builder then - report(groupcode,head) - end - head, done = pageactions(head,groupcode) - stoptiming(builders) - -- -- doesn't work here (not passed on?) - -- texset("pagegoal,texget("vsize") - texgetdimen("d_page_floats_inserted_top") - texgetdimen("d_page_floats_inserted_bottom") - texlists.contrib_head = head or nil -- needs checking - -- tex.setlist("contrib_head",head,head and nodes.tail(head)) - return done and head or true -- no return value needed - else - -- happens quite often - if trace_page_builder then - report(groupcode) - end - -- return nil, false -- no return value needed - return nil + head, done = pageactions(head,groupcode) + stoptiming(builders) + -- -- doesn't work here (not passed on?) + -- texset("pagegoal,texget("vsize") - texgetdimen("d_page_floats_inserted_top") - texgetdimen("d_page_floats_inserted_bottom") + texlists.contrib_head = head or nil -- needs checking + -- tex.setlist("contrib_head",head,head and nodes.tail(head)) + return done and head or true -- no return value needed + else + -- happens quite often + if trace_page_builder then + report(groupcode) end +-- return nil, false -- no return value needed + return nil end - end registercallback('vpack_filter', builders.vpack_filter, "vertical spacing etc") diff --git a/tex/context/base/mkiv/util-lib.lua b/tex/context/base/mkiv/util-lib.lua index a49507c60..be763d92e 100644 --- a/tex/context/base/mkiv/util-lib.lua +++ b/tex/context/base/mkiv/util-lib.lua @@ -6,6 +6,8 @@ if not modules then modules = { } end modules ['util-lib'] = { license = "see context related readme files", } +-- not used in context any more + --[[ The problem with library bindings is manyfold. They are of course platform diff --git a/tex/context/base/mkiv/util-soc-imp-http.lua b/tex/context/base/mkiv/util-soc-imp-http.lua index c3a28be82..d8f45880e 100644 --- a/tex/context/base/mkiv/util-soc-imp-http.lua +++ b/tex/context/base/mkiv/util-soc-imp-http.lua @@ -59,7 +59,7 @@ local function receiveheaders(sock, headers) headers = { } end -- get first line - local line, err = sock:receive() + local line, err = sock:receive("*l") -- this seems to be wrong! if err then return nil, err end @@ -72,14 +72,14 @@ local function receiveheaders(sock, headers) end name = lower(name) -- get next line (value might be folded) - line, err = sock:receive() + line, err = sock:receive("*l") if err then return nil, err end -- unfold any folded values while find(line, "^%s") do value = value .. line - line = sock:receive() + line = sock:receive("*l") if err then return nil, err end @@ -103,7 +103,7 @@ socket.sourcet["http-chunked"] = function(sock, headers) dirty = function() return sock:dirty() end, }, { __call = function() - local line, err = sock:receive() + local line, err = sock:receive("*l") if err then return nil, err end @@ -114,7 +114,7 @@ socket.sourcet["http-chunked"] = function(sock, headers) if size > 0 then local chunk, err, part = sock:receive(size) if chunk then - sock:receive() + sock:receive("*a") end return chunk, err else |