diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-06-10 16:38:16 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2018-06-10 16:38:16 +0200 |
commit | bd8f4d00a5ba1af56451821cd1db1c12c22f5419 (patch) | |
tree | 4dffba85530d56d31a05684c7c071b77d163371a /tex/context | |
parent | 93dccfc40625a754b372edd228724969b28e4342 (diff) | |
download | context-bd8f4d00a5ba1af56451821cd1db1c12c22f5419.tar.gz |
2018-06-10 15:49:00
Diffstat (limited to 'tex/context')
-rw-r--r-- | tex/context/base/mkii/cont-new.mkii | 2 | ||||
-rw-r--r-- | tex/context/base/mkii/context.mkii | 2 | ||||
-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/font-def.lua | 111 | ||||
-rw-r--r-- | tex/context/base/mkiv/mlib-lua.lua | 8 | ||||
-rw-r--r-- | tex/context/base/mkiv/mlib-pps.lua | 39 | ||||
-rw-r--r-- | tex/context/base/mkiv/mlib-run.lua | 17 | ||||
-rw-r--r-- | tex/context/base/mkiv/status-files.pdf | bin | 26064 -> 26040 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/status-lua.pdf | bin | 260163 -> 260188 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/strc-tag.mkiv | 4 | ||||
-rw-r--r-- | tex/context/interface/mkiv/i-context.pdf | bin | 844343 -> 844242 bytes | |||
-rw-r--r-- | tex/context/interface/mkiv/i-readme.pdf | bin | 61086 -> 61086 bytes |
13 files changed, 105 insertions, 82 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index 7aed27917..9bc20d6ab 100644 --- a/tex/context/base/mkii/cont-new.mkii +++ b/tex/context/base/mkii/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2018.06.09 14:30} +\newcontextversion{2018.06.10 15:42} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/mkii/context.mkii b/tex/context/base/mkii/context.mkii index 003bcd0c1..5358f59af 100644 --- a/tex/context/base/mkii/context.mkii +++ b/tex/context/base/mkii/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2018.06.09 14:30} +\edef\contextversion{2018.06.10 15:42} %D For those who want to use this: diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 0f226d75f..26de0cbf1 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2018.06.09 14:30} +\newcontextversion{2018.06.10 15:42} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index 9d171901f..57c1158da 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -42,7 +42,7 @@ %D has to match \type {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2018.06.09 14:30} +\edef\contextversion{2018.06.10 15:42} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/mkiv/font-def.lua b/tex/context/base/mkiv/font-def.lua index 7b3beda73..e5101e7f6 100644 --- a/tex/context/base/mkiv/font-def.lua +++ b/tex/context/base/mkiv/font-def.lua @@ -80,55 +80,6 @@ and prepares a table that will move along as we proceed.</p> -- name name(sub) name(sub)*spec name*spec -- name@spec*oeps -local splitter, splitspecifiers = nil, "" -- not so nice - -local P, C, S, Cc, Cs = lpeg.P, lpeg.C, lpeg.S, lpeg.Cc, lpeg.Cs - -local left = P("(") -local right = P(")") -local colon = P(":") -local space = P(" ") -local lbrace = P("{") -local rbrace = P("}") - -definers.defaultlookup = "file" - -local prefixpattern = P(false) - -local function addspecifier(symbol) - splitspecifiers = splitspecifiers .. symbol - local method = S(splitspecifiers) - local lookup = C(prefixpattern) * colon - local sub = left * C(P(1-left-right-method)^1) * right - local specification = C(method) * C(P(1)^1) - local name = Cs((lbrace/"") * (1-rbrace)^1 * (rbrace/"") + (1-sub-specification)^1) - splitter = P((lookup + Cc("")) * name * (sub + Cc("")) * (specification + Cc(""))) -end - -local function addlookup(str,default) - prefixpattern = prefixpattern + P(str) -end - -definers.addlookup = addlookup - -addlookup("file") -addlookup("name") -addlookup("spec") - -local function getspecification(str) - return lpegmatch(splitter,str or "") -- weird catch -end - -definers.getspecification = getspecification - -function definers.registersplit(symbol,action,verbosename) - addspecifier(symbol) - variants[symbol] = action - if verbosename then - variants[verbosename] = action - end -end - local function makespecification(specification,lookup,name,sub,method,detail,size) size = size or 655360 if not lookup or lookup == "" then @@ -153,13 +104,65 @@ local function makespecification(specification,lookup,name,sub,method,detail,siz return t end - definers.makespecification = makespecification -function definers.analyze(specification, size) - -- can be optimized with locals - local lookup, name, sub, method, detail = getspecification(specification or "") - return makespecification(specification, lookup, name, sub, method, detail, size) +if context then + + local splitter, splitspecifiers = nil, "" -- not so nice + + local P, C, S, Cc, Cs = lpeg.P, lpeg.C, lpeg.S, lpeg.Cc, lpeg.Cs + + local left = P("(") + local right = P(")") + local colon = P(":") + local space = P(" ") + local lbrace = P("{") + local rbrace = P("}") + + definers.defaultlookup = "file" + + local prefixpattern = P(false) + + local function addspecifier(symbol) + splitspecifiers = splitspecifiers .. symbol + local method = S(splitspecifiers) + local lookup = C(prefixpattern) * colon + local sub = left * C(P(1-left-right-method)^1) * right + local specification = C(method) * C(P(1)^1) + local name = Cs((lbrace/"") * (1-rbrace)^1 * (rbrace/"") + (1-sub-specification)^1) + splitter = P((lookup + Cc("")) * name * (sub + Cc("")) * (specification + Cc(""))) + end + + local function addlookup(str) + prefixpattern = prefixpattern + P(str) + end + + definers.addlookup = addlookup + + addlookup("file") + addlookup("name") + addlookup("spec") + + local function getspecification(str) + return lpegmatch(splitter,str or "") -- weird catch + end + + definers.getspecification = getspecification + + function definers.registersplit(symbol,action,verbosename) + addspecifier(symbol) + variants[symbol] = action + if verbosename then + variants[verbosename] = action + end + end + + function definers.analyze(specification, size) + -- can be optimized with locals + local lookup, name, sub, method, detail = getspecification(specification or "") + return makespecification(specification, lookup, name, sub, method, detail, size) + end + end --[[ldx-- diff --git a/tex/context/base/mkiv/mlib-lua.lua b/tex/context/base/mkiv/mlib-lua.lua index 1faefa68e..675be15bc 100644 --- a/tex/context/base/mkiv/mlib-lua.lua +++ b/tex/context/base/mkiv/mlib-lua.lua @@ -26,14 +26,14 @@ local report_message = logs.reporter("metapost") local trace_luarun = false trackers.register("metapost.lua",function(v) trace_luarun = v end) local trace_enabled = true -local be_tolerant = true directives.register("metapost.lua.tolerant",function(v) be_tolerant = v end) +local be_tolerant = true directives.register("metapost.lua.tolerant", function(v) be_tolerant = v end) mp = mp or { } -- system namespace MP = MP or { } -- user namespace local buffer = { } local n = 0 -local max = 10 -- we reuse upto max +local max = 20 -- we reuse upto max local nesting = 0 function mp._f_() @@ -376,6 +376,8 @@ function metapost.nofscriptruns() return runs end +-- there is no gain in: +-- -- local cache = table.makeweak() -- -- f = cache[code] @@ -393,7 +395,6 @@ end function metapost.runscript(code) nesting = nesting + 1 - local trace = trace_enabled and trace_luarun if trace then report_luarun("%i: code: %s",nesting,code) @@ -431,7 +432,6 @@ function metapost.runscript(code) else report_luarun("%i: no result, invalid code: %s",nesting,code) end - nesting = nesting - 1 return "" end diff --git a/tex/context/base/mkiv/mlib-pps.lua b/tex/context/base/mkiv/mlib-pps.lua index 91377f468..3d361f835 100644 --- a/tex/context/base/mkiv/mlib-pps.lua +++ b/tex/context/base/mkiv/mlib-pps.lua @@ -6,7 +6,7 @@ if not modules then modules = { } end modules ['mlib-pps'] = { license = "see context related readme files", } -local format, gmatch, match, split = string.format, string.gmatch, string.match, string.split +local format, gmatch, match, split, gsub = string.format, string.gmatch, string.match, string.split, string.gsub local tonumber, type, unpack, next, select = tonumber, type, unpack, next, select local round, sqrt, min, max = math.round, math.sqrt, math.min, math.max local insert, remove, concat = table.insert, table.remove, table.concat @@ -1071,6 +1071,27 @@ local tx_reset, tx_analyze, tx_process do local box = textakebox("mptextbox") top.textexts[mp_target] = box mp.triplet(bp*box.width,bp*box.height,bp*box.depth) + madetext = nil + end + + local madetext = nil + + function mp.MadeText(index) + mp.SomeText(index,madetext) + end + + function metapost.maketext(s,mode) + if mode and mode == 1 then + if trace_btexetex then + report_metapost("ignoring verbatimtex: [[%s]]",s) + end + else + if trace_btexetex then + report_metapost("handling btex ... etex: [[%s]]",s) + end + madetext = s + return "rawmadetext" + end end function mp.SomeFormattedText(index,fmt,...) @@ -1311,6 +1332,22 @@ local tx_reset, tx_analyze, tx_process do end end + local f_textext = formatters[ [[rawtextext("%s")]] ] + + function metapost.maketext(s,mode) + if mode and mode == 1 then + if trace_btexetex then + report_metapost("ignoring verbatimtex: [[%s]]",s) + end + else + if trace_btexetex then + report_metapost("handling btex ... etex: [[%s]]",s) + end + s = gsub(s,'"','"&ditto&"') + return f_textext(s) + end + end + end end diff --git a/tex/context/base/mkiv/mlib-run.lua b/tex/context/base/mkiv/mlib-run.lua index ae1c589e8..9369e9db0 100644 --- a/tex/context/base/mkiv/mlib-run.lua +++ b/tex/context/base/mkiv/mlib-run.lua @@ -30,7 +30,6 @@ nears zero.</p> --ldx]]-- local type, tostring, tonumber, next = type, tostring, tonumber, next -local gsub, match, find = string.gsub, string.match, string.find local striplines = utilities.strings.striplines local concat, insert, remove = table.concat, table.insert, table.remove @@ -209,22 +208,6 @@ end -- todo: random_seed -local f_textext = formatters[ [[rawtextext("%s")]] ] - -function metapost.maketext(s,mode) - if mode and mode == 1 then - if trace_btexetex then - report_metapost("ignoring verbatimtex: [[%s]]",s) - end - else - if trace_btexetex then - report_metapost("handling btex ... etex: [[%s]]",s) - end - s = gsub(s,'"','"&ditto&"') - return f_textext(s) - end -end - local seed = nil function metapost.load(name,method) diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex 5fc519b39..5698d1e1f 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 6df30cade..d7df10fdb 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-tag.mkiv b/tex/context/base/mkiv/strc-tag.mkiv index 0f8b46df9..60ea17378 100644 --- a/tex/context/base/mkiv/strc-tag.mkiv +++ b/tex/context/base/mkiv/strc-tag.mkiv @@ -313,7 +313,7 @@ \unexpanded\def\strc_tags_disable {\ifconditional\c_strc_tags_enabled % so now all are artifacts - \let\dostarttagged \strc_tags_start_nop_ignore + \let\dostarttagged \strc_tags_start_nop_detail \let\dostarttaggednodetail\strc_tags_start_nop_no_detail \let\dostarttaggedchained \strc_tags_start_nop_chained \let\dostoptagged \strc_tags_stop_nop_ignore @@ -322,7 +322,7 @@ \let\dostarttagged \strc_tags_start_nop_detail \let\dostarttaggednodetail\strc_tags_start_nop_no_detail \let\dostarttaggedchained \strc_tags_start_nop_chained - \let\dostoptagged \strc_tags_stop_nop + \let\dostoptagged \strc_tags_stop_nop_ignore \let\dostartignoretagging \strc_tags_start_nop_ignore \let\dostopignoretagging \strc_tags_stop_nop_ignore \fi} diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf Binary files differindex 9afd18d27..fde82a864 100644 --- a/tex/context/interface/mkiv/i-context.pdf +++ b/tex/context/interface/mkiv/i-context.pdf diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf Binary files differindex fc23c7d59..ad2a27ac3 100644 --- a/tex/context/interface/mkiv/i-readme.pdf +++ b/tex/context/interface/mkiv/i-readme.pdf |