summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2021-08-24 22:54:31 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2021-08-24 22:54:31 +0200
commit59dfd8f21ca1a5c793a89b6af87a28df5a78a3d3 (patch)
tree65f4576f84667c2c2200b42f6c0cf1de3b850ade /tex/context/base/mkiv
parent4d2f305f0f00e1d6d6c03443596a830bfb9da69c (diff)
downloadcontext-59dfd8f21ca1a5c793a89b6af87a28df5a78a3d3.tar.gz
2021-08-24 22:16:00
Diffstat (limited to 'tex/context/base/mkiv')
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv2
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/grph-fil.lua142
-rw-r--r--tex/context/base/mkiv/mult-fun.lua4
-rw-r--r--tex/context/base/mkiv/mult-low.lua1
-rw-r--r--tex/context/base/mkiv/mult-prm.lua5
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin24879 -> 24877 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin250316 -> 250465 bytes
-rw-r--r--tex/context/base/mkiv/util-sbx.lua4
9 files changed, 85 insertions, 75 deletions
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index f0b4107f9..07e1b0334 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.08.22 11:51}
+\newcontextversion{2021.08.24 22:14}
%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 dea117595..cb4cae649 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.08.22 11:51}
+\edef\contextversion{2021.08.24 22:14}
%D Kind of special:
diff --git a/tex/context/base/mkiv/grph-fil.lua b/tex/context/base/mkiv/grph-fil.lua
index 2cf2a54cc..aad110e1c 100644
--- a/tex/context/base/mkiv/grph-fil.lua
+++ b/tex/context/base/mkiv/grph-fil.lua
@@ -46,7 +46,7 @@ job.register('job.files.collected', tobesaved, initializer)
-- pass the orginal path. But we pass it because it will prevent prepending the
-- current direction to the given name.
-local runner = sandbox.registerrunner {
+local contextrunner = sandbox.registerrunner {
name = "hashed context run",
program = "context",
template = [[%options% %?path: --runpath=%path% ?% %filename%]],
@@ -68,7 +68,79 @@ local runner = sandbox.registerrunner {
-- The runpath features makes things more complex than needed, so we need to wrap
-- that some day in a helper. This is also very sensitive for both being set!
-local function analyzed(name)
+function jobfiles.run(action)
+ local filename = action.filename
+ if filename and filename ~= "" then
+ local result = action.result
+ local runner = action.runner or contextrunner
+ local oldchecksum = collected[filename]
+ local newchecksum = checksum(filename)
+ local tobedone = false
+ local forcerun = action.forcerun or jobfiles.forcerun
+ if not result then
+ result = replacesuffix(usedname,resultsuffix)
+ action.result = result
+ end
+ if forcerun then
+ tobedone = true
+ if trace_run then
+ report_run("processing file, changes in %a, %s",filename,"processing forced")
+ end
+ end
+ if not tobedone and not oldchecksum then
+ tobedone = true
+ if trace_run then
+ report_run("processing file, changes in %a, %s",filename,"no checksum yet")
+ end
+ end
+ if not tobedone and oldchecksum ~= newchecksum then
+ tobedone = true
+ if trace_run then
+ report_run("processing file, changes in %a, %s",filename,"checksum mismatch")
+ end
+ end
+ if not tobedone and not isfile(result) then
+ tobedone = true
+ if trace_run then
+ report_run("processing file, changes in %a, %s",filename,"no result file")
+ end
+ end
+ if tobedone then
+ local kind = type(runner)
+ if kind == "function" then
+ if trace_run then
+ report_run("processing file, command: %s",action.name or "unknown")
+ end
+ -- We can have a sandbox.registerrunner here in which case we need to make
+ -- sure that we don't feed a function into the checker. So one cannot use a
+ -- variable named "runner" in the template but that's no big deal.
+ local r = action.runner
+ action.runner = nil
+ runner(action)
+ action.runner = r
+ elseif kind == "string" then
+ -- can be anything but we assume it gets checked by the sandbox
+ if trace_run then
+ report_run("processing file, command: %s",runner)
+ end
+ os.execute(runner)
+ else
+ report_run("processing file, changes in %a, %s",filename,"no valid runner")
+ end
+ elseif trace_run then
+ report_run("processing file, no changes in %a, %s",filename,"not processed")
+ end
+ tobesaved[filename] = newchecksum
+ else
+ -- silently ignore error
+ end
+end
+
+--
+
+local done = { }
+
+local function analyzed(name,options)
local actiontype = type(action)
local usedname = addsuffix(name,inputsuffix) -- we assume tex if not set
local resultname = replacesuffix(name,resultsuffix) -- we assume tex if not set
@@ -90,72 +162,6 @@ local function analyzed(name)
}
end
-function jobfiles.run(name,action)
- local kind = type(name)
- if kind == "string" then
- local usedname = addsuffix(name,inputsuffix)
- action = {
- filename = usedname,
- action = action,
- resultfile = replacesuffix(usedname,resultsuffix),
- }
- elseif kind == "table" then
- action = name
- else
- report_run("invalid specification for jobfiles.run")
- return
- end
- local filename = action.filename
- local result = action.result
- local oldchecksum = collected[filename]
- local newchecksum = checksum(filename)
- local tobedone = false
- if jobfiles.forcerun then
- tobedone = true
- if trace_run then
- report_run("processing file, changes in %a, %s",filename,"processing forced")
- end
- end
- if not tobedone and not oldchecksum then
- tobedone = true
- if trace_run then
- report_run("processing file, changes in %a, %s",filename,"no checksum yet")
- end
- end
- if not tobedone and oldchecksum ~= newchecksum then
- tobedone = true
- if trace_run then
- report_run("processing file, changes in %a, %s",filename,"checksum mismatch")
- end
- end
- if not tobedone and not isfile(result) then
- tobedone = true
- if trace_run then
- report_run("processing file, changes in %a, %s",filename,"no result file")
- end
- end
- if tobedone then
- kind = type(action)
- if kind == "function" then
- action(filename)
- elseif kind == "string" and action ~= "" then
- -- can be anything but we assume it gets checked by the sandbox
- os.execute(action)
- elseif kind == "table" then
- runner(action)
- else
- report_run("processing file, no action given for processing %a",name)
- end
- elseif trace_run then
- report_run("processing file, no changes in %a, not processed",name)
- end
- tobesaved[filename] = newchecksum
-end
-
---
-
-local done = { }
-
function jobfiles.context(name,options) -- runpath ?
if type(name) == "table" then
local result = { }
diff --git a/tex/context/base/mkiv/mult-fun.lua b/tex/context/base/mkiv/mult-fun.lua
index 9f6c8456c..097b906fd 100644
--- a/tex/context/base/mkiv/mult-fun.lua
+++ b/tex/context/base/mkiv/mult-fun.lua
@@ -197,8 +197,8 @@ return {
"getpospage", "getposparagraph", "getposcolumn", "getposregion",
"getposx", "getposy", "getposwidth", "getposheight", "getposdepth",
"getposleftskip", "getposrightskip", "getposhsize", "getposparindent", "getposhangindent", "getposhangafter",
- "getposxy", "getposupperleft", "getposlowerleft", "getposupperright", "getposlowerright".
- "getposllx", "getposlly", "getposurx", "getposury" ;
+ "getposxy", "getposupperleft", "getposlowerleft", "getposupperright", "getposlowerright",
+ "getposllx", "getposlly", "getposurx", "getposury",
--
"wdpart", "htpart", "dppart",
--
diff --git a/tex/context/base/mkiv/mult-low.lua b/tex/context/base/mkiv/mult-low.lua
index 59320507a..5075ec579 100644
--- a/tex/context/base/mkiv/mult-low.lua
+++ b/tex/context/base/mkiv/mult-low.lua
@@ -182,6 +182,7 @@ return {
--
"normalizelinenormalizecode", "parindentskipnormalizecode", "swaphangindentnormalizecode", "swapparsshapenormalizecode",
"breakafterdirnormalizecode", "removemarginkernsnormalizecode", "clipwidthnormalizecode", "flattendiscretionariesnormalizecode",
+ "discardzerotabskipsnormalizecode",
--
"noligaturingglyphoptioncode", "nokerningglyphoptioncode", "noleftligatureglyphoptioncode",
"noleftkernglyphoptioncode", "norightligatureglyphoptioncode", "norightkernglyphoptioncode",
diff --git a/tex/context/base/mkiv/mult-prm.lua b/tex/context/base/mkiv/mult-prm.lua
index 408c1d651..6b88ba3b2 100644
--- a/tex/context/base/mkiv/mult-prm.lua
+++ b/tex/context/base/mkiv/mult-prm.lua
@@ -486,17 +486,19 @@ return {
"protrusionboundary",
"pxdimen",
"quitvmode",
+ "retokenized",
"rightmarginkern",
"rpcode",
"savecatcodetable",
"scantextokens",
+ "semiexpanded",
+ "semiprotected",
"setfontid",
"snapshotpar",
"supmarkmode",
"swapcsvalues",
"textdirection",
"thewithoutunit",
- "thewithproperty",
"tokenized",
"toksapp",
"tokspre",
@@ -835,6 +837,7 @@ return {
"nolimits",
"nonscript",
"nonstopmode",
+ "nonzerowidthkern",
"nulldelimiterspace",
"nullfont",
"number",
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 2f3480094..20bdd73ba 100644
--- a/tex/context/base/mkiv/status-files.pdf
+++ b/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf
index 54c5df511..2a6018336 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/util-sbx.lua b/tex/context/base/mkiv/util-sbx.lua
index cd282009e..066ca3023 100644
--- a/tex/context/base/mkiv/util-sbx.lua
+++ b/tex/context/base/mkiv/util-sbx.lua
@@ -330,7 +330,7 @@ local function validcommand(name,program,template,checkers,defaults,variables,re
-- for now, we will have a "flags" checker
else
local checker = validators[chktype]
- if checker then
+ if checker and type(value) == "string" then
value = checker(unquoted(value),strict)
if value then
variables[variable] = optionalquoted(value)
@@ -350,7 +350,7 @@ local function validcommand(name,program,template,checkers,defaults,variables,re
local chktype = checkers[variable]
if chktype == "verbose" then
-- for now, we will have a "flags" checker
- else
+ elseif type(default) == "string" then
local checker = validators[chktype]
if checker then
default = checker(unquoted(default),strict)