diff options
Diffstat (limited to 'tex/context/base/mkiv')
-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/data-bin.lua | 14 | ||||
-rw-r--r-- | tex/context/base/mkiv/data-inp.lua | 3 | ||||
-rw-r--r-- | tex/context/base/mkiv/grph-img.lua | 23 | ||||
-rw-r--r-- | tex/context/base/mkiv/status-files.pdf | bin | 24898 -> 24911 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/status-lua.pdf | bin | 250052 -> 250103 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/strc-blk.mkiv | 4 | ||||
-rw-r--r-- | tex/context/base/mkiv/util-prs.lua | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/util-str.lua | 2 |
10 files changed, 38 insertions, 14 deletions
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 29108424f..9863f8484 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.04 17:48} +\newcontextversion{2021.08.06 01:19} %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 aa17074b9..e984d930d 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.04 17:48} +\edef\contextversion{2021.08.06 01:19} %D Kind of special: diff --git a/tex/context/base/mkiv/data-bin.lua b/tex/context/base/mkiv/data-bin.lua index 2bac901ea..f455f7d9a 100644 --- a/tex/context/base/mkiv/data-bin.lua +++ b/tex/context/base/mkiv/data-bin.lua @@ -8,7 +8,8 @@ if not modules then modules = { } end modules ['data-bin'] = { local resolvers = resolvers local methodhandler = resolvers.methodhandler -local notfound = resolvers.loaders.notfound + +local notfound = resolvers.loaders.notfound function resolvers.findbinfile(filename,filetype) return methodhandler('finders',filename,filetype) @@ -28,3 +29,14 @@ function resolvers.loadbinfile(filename,filetype) return notfound() end end + +local notfound = resolvers.cleaners.notfound + +function resolvers.cleanupbinfile(filename) + local fname = methodhandler('finders',filename) + if fname and fname ~= "" then + return methodhandler('cleaners',fname) + else + return notfound() + end +end diff --git a/tex/context/base/mkiv/data-inp.lua b/tex/context/base/mkiv/data-inp.lua index 97fb8904b..569a66f4e 100644 --- a/tex/context/base/mkiv/data-inp.lua +++ b/tex/context/base/mkiv/data-inp.lua @@ -15,11 +15,14 @@ local registermethod = resolvers.registermethod local finders = allocate { helpers = { }, notfound = function() end } local openers = allocate { helpers = { }, notfound = function() end } local loaders = allocate { helpers = { }, notfound = function() return false, nil, 0 end } +local tracers = allocate { helpers = { }, notfound = function() end } registermethod("finders", finders, "uri") registermethod("openers", openers, "uri") registermethod("loaders", loaders, "uri") +registermethod("tracers", tracers, "uri") resolvers.finders = finders resolvers.openers = openers resolvers.loaders = loaders +resolvers.tracers = tracers diff --git a/tex/context/base/mkiv/grph-img.lua b/tex/context/base/mkiv/grph-img.lua index a982965ff..43299a84c 100644 --- a/tex/context/base/mkiv/grph-img.lua +++ b/tex/context/base/mkiv/grph-img.lua @@ -24,6 +24,15 @@ local graphics = graphics or { } local identifiers = { } graphics.identifiers = identifiers +local function checkedmethod(filename,method) + if method ~= "string" then + local found, data = resolvers.loadbinfile(filename) + return data, "string" + else + return filename, method + end +end + do local colorspaces = { @@ -222,6 +231,7 @@ do specification.error = "invalid filename" return specification -- error end + filename, method = checkedmethod(filename,method) local f = newreader(filename,method) if not f then specification.error = "unable to open file" @@ -454,6 +464,7 @@ do specification.error = "invalid filename" return specification -- error end + filename, method = checkedmethod(filename,method) local f = newreader(filename,method) if not f then specification.error = "unable to open file" @@ -558,6 +569,7 @@ do specification.error = "invalid filename" return specification -- error end + filename, method = checkedmethod(filename,method) local f = newreader(filename,method) if not f then specification.error = "unable to open file" @@ -727,21 +739,18 @@ end function graphics.identify(filename,filetype) local identify = filetype and identifiers[filetype] - if identify then - return identify(filename) + if not identify then + identify = identifiers[suffixonly(filename)] end - local identify = identifiers[suffixonly(filename)] if identify then - identify = identify(filename) + return identify(filename) else - identify = { + return { filename = filename, filetype = filetype, error = "identification failed", } end - -- inspect(identify) - return identify end -- inspect(identifiers.jpg("t:/sources/hacker.jpg")) diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex 873f89595..912ec565f 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 2de5b578b..6c3ca2ec2 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-blk.mkiv b/tex/context/base/mkiv/strc-blk.mkiv index 0b41b6dc2..3541d2852 100644 --- a/tex/context/base/mkiv/strc-blk.mkiv +++ b/tex/context/base/mkiv/strc-blk.mkiv @@ -1,4 +1,4 @@ -D \module +%D \module %D [ file=strc-blk, %D version=2008.10.20, %D title=\CONTEXT\ Structure Macros, @@ -177,6 +177,6 @@ D \module \unexpanded\def\processblocks{\doquadrupleempty\strc_blocks_select [process]} \unexpanded\def\selectblocks {\doquadrupleempty\strc_blocks_select [use]} -unexpanded\def\doifelseblocksempty{\clf_doifelsestructureblocksempty} % {name}{tag}{criterium} +\unexpanded\def\doifelseblocksempty{\clf_doifelsestructureblocksempty} % {name}{tag}{criterium} \protect \endinput diff --git a/tex/context/base/mkiv/util-prs.lua b/tex/context/base/mkiv/util-prs.lua index 6d2f8c19e..7e2bf0110 100644 --- a/tex/context/base/mkiv/util-prs.lua +++ b/tex/context/base/mkiv/util-prs.lua @@ -681,7 +681,7 @@ local spaces = lpegpatterns.space^0 local dummy = function() end setmetatableindex(cache,function(t,k) - local separator = P(k) + local separator = S(k) -- was P local value = (1-separator)^0 local pattern = spaces * C(value) * separator^0 * Cp() t[k] = pattern diff --git a/tex/context/base/mkiv/util-str.lua b/tex/context/base/mkiv/util-str.lua index e58befe30..67146d80f 100644 --- a/tex/context/base/mkiv/util-str.lua +++ b/tex/context/base/mkiv/util-str.lua @@ -635,7 +635,7 @@ return function(%s) return %s end local pattern = Cs(Cc('"') * ( (1-S('"\\\n\r'))^1 + P('"') / '\\034' - + P('\\') / '\\020' + + P('\\') / '\\092' + P('\n') / '\\013' + P('\r') / '\\010' )^0 * Cc('"')) |