summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv')
-rw-r--r--tex/context/base/mkiv/buff-ini.lua10
-rw-r--r--tex/context/base/mkiv/buff-ver.lua48
-rw-r--r--tex/context/base/mkiv/cldf-ini.lua2
-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/font-con.lua4
-rw-r--r--tex/context/base/mkiv/font-fil.mkvi25
-rw-r--r--tex/context/base/mkiv/font-ots.lua4
-rw-r--r--tex/context/base/mkiv/grph-inc.lua6
-rw-r--r--tex/context/base/mkiv/luat-cnf.lua4
-rw-r--r--tex/context/base/mkiv/luat-cod.lua2
-rw-r--r--tex/context/base/mkiv/node-fnt.lua3
-rw-r--r--tex/context/base/mkiv/node-nut.lua2
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin26607 -> 26602 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin268320 -> 268486 bytes
-rw-r--r--tex/context/base/mkiv/strc-ren.mkiv6
-rw-r--r--tex/context/base/mkiv/toks-ini.lua7
-rw-r--r--tex/context/base/mkiv/toks-scn.lua5
-rw-r--r--tex/context/base/mkiv/util-prs.lua24
19 files changed, 130 insertions, 26 deletions
diff --git a/tex/context/base/mkiv/buff-ini.lua b/tex/context/base/mkiv/buff-ini.lua
index bd3cf9d5a..ecb5d9dd0 100644
--- a/tex/context/base/mkiv/buff-ini.lua
+++ b/tex/context/base/mkiv/buff-ini.lua
@@ -351,11 +351,17 @@ buffers.undent = undent
-- commands.doifelse(more)
-- end
+local split = table.setmetatableindex(function(t,k)
+ local v = totable(k)
+ t[k] = v
+ return v
+end)
+
function tokens.pickup(start,stop)
- local stoplist = totable(stop)
+ local stoplist = split[stop] -- totable(stop)
local stoplength = #stoplist
local stoplast = stoplist[stoplength]
- local startlist = totable(start)
+ local startlist = split[start] -- totable(start)
local startlength = #startlist
local startlast = startlist[startlength]
local list = { }
diff --git a/tex/context/base/mkiv/buff-ver.lua b/tex/context/base/mkiv/buff-ver.lua
index 88605631d..969a28055 100644
--- a/tex/context/base/mkiv/buff-ver.lua
+++ b/tex/context/base/mkiv/buff-ver.lua
@@ -817,7 +817,7 @@ local function typestring(settings)
local compact = settings.compact
local compactor = compact and compactors[compact]
if compactor then
- content = lpegmatch(compactor,content)
+ content = lpegmatch(compactor,content) or content
end
-- content = decodecomment(content)
-- content = dotabs(content,settings)
@@ -853,7 +853,7 @@ implement {
actions = typestring,
arguments = {
{
- { "data" },
+ { "data" },
{ "tab" },
{ "method" },
{ "compact" },
@@ -863,6 +863,50 @@ implement {
}
}
+-- implement {
+-- name = "type_x",
+-- actions = typestring,
+-- arguments = {
+-- {
+-- { "data", "verbatim" },
+-- { "tab" },
+-- { "method" },
+-- { "compact" },
+-- { "nature" },
+-- { "escape" },
+-- }
+-- }
+-- }
+
+-- local function typestring_y(settings)
+-- local content = tex.toks[settings.n]
+-- if content and content ~= "" then
+-- local compact = settings.compact
+-- local compactor = compact and compactors[compact]
+-- if compactor then
+-- content = lpegmatch(compactor,content)
+-- end
+-- -- content = decodecomment(content)
+-- -- content = dotabs(content,settings)
+-- visualize(content,checkedsettings(settings,"inline"))
+-- end
+-- end
+
+-- implement {
+-- name = "type_y",
+-- actions = typestring_y,
+-- arguments = {
+-- {
+-- { "n", "integer" },
+-- { "tab" },
+-- { "method" },
+-- { "compact" },
+-- { "nature" },
+-- { "escape" },
+-- }
+-- }
+-- }
+
implement {
name = "processbuffer",
actions = processbuffer,
diff --git a/tex/context/base/mkiv/cldf-ini.lua b/tex/context/base/mkiv/cldf-ini.lua
index 9b1a4e368..ccbbb2454 100644
--- a/tex/context/base/mkiv/cldf-ini.lua
+++ b/tex/context/base/mkiv/cldf-ini.lua
@@ -137,7 +137,7 @@ function context.trialtypesetting()
return texgetcount(trialtypesettingstate) ~= 0
end
-local knownfunctions = lua.get_functions_table()
+local knownfunctions = lua.get_functions_table(true)
local showstackusage = false
trackers.register("context.stack",function(v) showstackusage = v end)
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index f47b4062f..913fa747f 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{2019.02.26 20:04}
+\newcontextversion{2019.03.05 15:40}
%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 067af94f6..81558c98a 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{2019.02.26 20:04}
+\edef\contextversion{2019.03.05 15:40}
\edef\contextkind {beta}
%D Kind of special:
diff --git a/tex/context/base/mkiv/font-con.lua b/tex/context/base/mkiv/font-con.lua
index f0f2fb5a2..93ce9f5da 100644
--- a/tex/context/base/mkiv/font-con.lua
+++ b/tex/context/base/mkiv/font-con.lua
@@ -712,7 +712,7 @@ function constructors.scale(tfmdata,specification)
height = height,
depth = depth,
width = width,
- unicode = unicode,
+ unicode = isunicode,
}
else
chr = {
@@ -728,7 +728,7 @@ function constructors.scale(tfmdata,specification)
index = index,
height = height,
width = width,
- unicode = unicode,
+ unicode = isunicode,
}
else
chr = {
diff --git a/tex/context/base/mkiv/font-fil.mkvi b/tex/context/base/mkiv/font-fil.mkvi
index 16ce57f8a..ae83ef4c4 100644
--- a/tex/context/base/mkiv/font-fil.mkvi
+++ b/tex/context/base/mkiv/font-fil.mkvi
@@ -85,22 +85,39 @@
\expandafter\font_basics_define_font_synonym_yes
\fi}
-\def\font_basics_define_font_synonym_nop
+\unexpanded\def\font_basics_define_font_synonym_nop
{\expandafter\let\csname\??fontfile\m_font_name\endcsname\m_font_file
\doifelsenextoptionalcs\font_basics_define_font_synonym_nop_opt\font_basics_define_font_synonym_nop_nil}
-\def\font_basics_define_font_synonym_yes
+\unexpanded\def\font_basics_define_font_synonym_yes
{\expandafter\let\csname\??fontfile\fontclass\m_font_name\endcsname\m_font_file
\doifelsenextoptionalcs\font_basics_define_font_synonym_yes_opt\font_basics_define_font_synonym_yes_nil}
-\def\font_basics_define_font_synonym_nop_opt[#specification]%
+\unexpanded\def\edefinefontsynonym[#name]#crap[#file]%
+ {\edef\m_font_name{#name}%
+ \edef\m_font_file{#file}%
+ \ifx\fontclass\empty
+ \expandafter\font_basics_define_font_synonym_nop_expanded
+ \else
+ \expandafter\font_basics_define_font_synonym_yes_expanded
+ \fi}
+
+\unexpanded\def\font_basics_define_font_synonym_nop_expanded#crap[#spec]%
+ {\expandafter\let\csname\??fontfile\m_font_name\endcsname\m_font_file
+ \normalexpanded{\font_basics_define_font_synonym_nop_opt[#1]}}
+
+\unexpanded\def\font_basics_define_font_synonym_yes_expanded#crap[#spec]%
+ {\expandafter\let\csname\??fontfile\fontclass\m_font_name\endcsname\m_font_file
+ \normalexpanded{\font_basics_define_font_synonym_yes_opt[#spec]}}
+
+\unexpanded\def\font_basics_define_font_synonym_nop_opt[#specification]%
{\let\p_features \undefined
\let\p_fallbacks \undefined
\let\p_goodies \undefined
\let\p_designsize\undefined
\expandafter\font_basics_get_font_parameter_nop#specification,]=,}
-\def\font_basics_define_font_synonym_yes_opt[#specification]%
+\unexpanded\def\font_basics_define_font_synonym_yes_opt[#specification]%
{\let\p_features \undefined
\let\p_fallbacks \undefined
\let\p_goodies \undefined
diff --git a/tex/context/base/mkiv/font-ots.lua b/tex/context/base/mkiv/font-ots.lua
index 563094fc1..b9f719a5f 100644
--- a/tex/context/base/mkiv/font-ots.lua
+++ b/tex/context/base/mkiv/font-ots.lua
@@ -829,7 +829,7 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
end
end
if not match and not pre or not replace then
- local n = getnext(discfound)
+ local n = getnext(discfound)
local char = ischar(n,currentfont)
if char and ligature[char] then
match = true
@@ -841,8 +841,8 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
local prev = getprev(start)
if stop then
setnext(stop)
- local tail = getprev(stop)
local copy = copy_node_list(start)
+ local tail = stop -- was: getprev(stop) -- Kai: needs checking on your samples
local liat = find_node_tail(copy)
if pre then
setlink(liat,pre)
diff --git a/tex/context/base/mkiv/grph-inc.lua b/tex/context/base/mkiv/grph-inc.lua
index c740d424d..f66f8249a 100644
--- a/tex/context/base/mkiv/grph-inc.lua
+++ b/tex/context/base/mkiv/grph-inc.lua
@@ -124,8 +124,8 @@ local ctx_doboxfigureobject = context.doboxfigureobject
function checkimage(figure)
if figure then
- local width = figure.width
- local height = figure.height
+ local width = figure.width or 0
+ local height = figure.height or 0
if width <= 0 or height <= 0 then
report_inclusion("image %a has bad dimensions (%p,%p), discarding",figure.filename or "?",width,height)
return false, "bad dimensions"
@@ -918,6 +918,7 @@ local function register(askedname,specification)
format = suffix
end
end
+specification.format = format
elseif io.exists(oldname) then
report_inclusion("file %a is bugged",oldname)
if format and imagetypes[format] then
@@ -1285,6 +1286,7 @@ function figures.identify(data)
for i=1,#list do
local identifier = list[i]
local data = identifier(data)
+-- if data and (not data.status and data.status.status > 0) then
if data and (not data.status and data.status.status > 0) then
break
end
diff --git a/tex/context/base/mkiv/luat-cnf.lua b/tex/context/base/mkiv/luat-cnf.lua
index 0670d1684..5e3f026e9 100644
--- a/tex/context/base/mkiv/luat-cnf.lua
+++ b/tex/context/base/mkiv/luat-cnf.lua
@@ -30,6 +30,8 @@ texconfig.nest_size = 1000
texconfig.param_size = 25000
texconfig.save_size = 100000
texconfig.stack_size = 10000
+texconfig.function_size = 32768
+texconfig.properties_size = 65536
local stub = [[
@@ -178,6 +180,8 @@ local variablenames = {
param_size = true,
save_size = true,
stack_size = true,
+ function_size = true,
+ properties_size = true,
}
local function makestub()
diff --git a/tex/context/base/mkiv/luat-cod.lua b/tex/context/base/mkiv/luat-cod.lua
index dcb16c0dd..c667f3ecc 100644
--- a/tex/context/base/mkiv/luat-cod.lua
+++ b/tex/context/base/mkiv/luat-cod.lua
@@ -30,6 +30,8 @@ texconfig.nest_size = 1000
texconfig.param_size = 25000
texconfig.save_size = 100000
texconfig.stack_size = 10000
+texconfig.function_size = 32768
+texconfig.properties_size = 65536
-- registering bytecode chunks
diff --git a/tex/context/base/mkiv/node-fnt.lua b/tex/context/base/mkiv/node-fnt.lua
index 154853121..01d7e42e5 100644
--- a/tex/context/base/mkiv/node-fnt.lua
+++ b/tex/context/base/mkiv/node-fnt.lua
@@ -437,6 +437,8 @@ do
local prevfont = nil
local prevattr = nil
local none = false
+ firstnone = nil
+ basefont = nil
for n, char, font in nextchar, r do
local attr = getattr(n) or 0 -- zero attribute is reserved for fonts in context
if font ~= prevfont or attr ~= prevattr then
@@ -446,6 +448,7 @@ do
if fontmode == "none" then
setnone(n)
elseif fontmode == "base" then
+ -- so the replace gets an extra treatment ... so be it
setbase(n)
else
setnode(n,font,attr)
diff --git a/tex/context/base/mkiv/node-nut.lua b/tex/context/base/mkiv/node-nut.lua
index 6a38cca67..50e87e988 100644
--- a/tex/context/base/mkiv/node-nut.lua
+++ b/tex/context/base/mkiv/node-nut.lua
@@ -697,7 +697,7 @@ nuts.nestedtracedslide = nestedtracedslide
-- this might move
-local propertydata = direct.get_properties_table and direct.get_properties_table()
+local propertydata = direct.get_properties_table(true)
local getattr = nuts.getattr
local setattr = nuts.setattr
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index bdc763ec3..d0d2324d8 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 6fafd9c50..a0d9f04f4 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/strc-ren.mkiv b/tex/context/base/mkiv/strc-ren.mkiv
index 01464ad86..5cdf5f4a7 100644
--- a/tex/context/base/mkiv/strc-ren.mkiv
+++ b/tex/context/base/mkiv/strc-ren.mkiv
@@ -376,10 +376,12 @@
\egroup
\ifconditional\headisdisplay
\useindentnextparameter\headparameter
+ \else\ifconditional\headissomewhere
+ \ignoreparskip
+ \noindentation
\else
\ignoreparskip
- \noindentation % recently added, was a bug
- \fi}
+ \fi\fi}
% nice testcase
%
diff --git a/tex/context/base/mkiv/toks-ini.lua b/tex/context/base/mkiv/toks-ini.lua
index 43e2d80a3..2c85a5754 100644
--- a/tex/context/base/mkiv/toks-ini.lua
+++ b/tex/context/base/mkiv/toks-ini.lua
@@ -33,6 +33,7 @@ end
local scan_toks = token.scan_toks
local scan_string = token.scan_string
local scan_argument = token.scan_argument
+local scan_tokenlist = token.scan_tokenlist
local scan_int = token.scan_int
local scan_code = token.scan_code
local scan_dimen = token.scan_dimen
@@ -208,6 +209,10 @@ if not scan_csname then
end
+local function scan_verbatim()
+ return scan_argument(false)
+end
+
tokens.scanners = { -- these expand
token = scan_token,
toks = scan_toks,
@@ -222,6 +227,8 @@ tokens.scanners = { -- these expand
count = scan_int,
string = scan_string,
argument = scan_argument,
+ tokenlist = scan_tokenlist,
+ verbatim = scan_verbatim,
code = scan_code,
word = scan_word,
number = scan_number,
diff --git a/tex/context/base/mkiv/toks-scn.lua b/tex/context/base/mkiv/toks-scn.lua
index f73ecc86c..297ef7121 100644
--- a/tex/context/base/mkiv/toks-scn.lua
+++ b/tex/context/base/mkiv/toks-scn.lua
@@ -22,6 +22,8 @@ local tokenbits = tokens.bits
local scanstring = scanners.string
local scanargument = scanners.argument
+local scanverbatim = scanners.verbatim
+local scantokenlist = scanners.tokenlist
local scaninteger = scanners.integer
local scannumber = scanners.number
local scankeyword = scanners.keyword
@@ -149,6 +151,9 @@ local shortcuts = {
close = close,
scanners = scanners,
scanstring = scanstring,
+ scanargument = scanargument,
+ scanverbatim = scanverbatim,
+ scantokenlist = scantokenlist,
scaninteger = scaninteger,
scannumber = scannumber,
scantable = scantable,
diff --git a/tex/context/base/mkiv/util-prs.lua b/tex/context/base/mkiv/util-prs.lua
index ba73a9481..3154bf6c2 100644
--- a/tex/context/base/mkiv/util-prs.lua
+++ b/tex/context/base/mkiv/util-prs.lua
@@ -774,13 +774,22 @@ end
-- print(parsers.splitmethod("{foo}"))
-- print(parsers.splitmethod())
+local p_year = lpegpatterns.digit^4 / tonumber
+
local pattern = Cf( Ct("") *
- Cg(Cc("year") * cardinal)
- * P("-") * Cg(Cc("month") * cardinal)
- * P("-") * Cg(Cc("day") * cardinal)
- * P(" ") * Cg(Cc("hour") * cardinal)
- * P(":") * Cg(Cc("minute") * cardinal)
- * (P(":") * Cg(Cc("sec") * cardinal))^-1
+ (
+ ( Cg(Cc("year") * p_year)
+ * S("-/") * Cg(Cc("month") * cardinal)
+ * S("-/") * Cg(Cc("day") * cardinal)
+ ) +
+ ( Cg(Cc("day") * cardinal)
+ * S("-/") * Cg(Cc("month") * cardinal)
+ * S("-/") * Cg(Cc("year") * p_year)
+ )
+ )
+ * P(" ") * Cg(Cc("hour") * cardinal)
+ * P(":") * Cg(Cc("min") * cardinal)
+ * (P(":") * Cg(Cc("sec") * cardinal))^-1
, rawset)
lpegpatterns.splittime = pattern
@@ -790,3 +799,6 @@ function parsers.totime(str)
end
-- print(os.time(parsers.totime("2019-03-05 12:12:12")))
+-- print(os.time(parsers.totime("2019/03/05 12:12:12")))
+-- print(os.time(parsers.totime("05-03-2019 12:12:12")))
+-- print(os.time(parsers.totime("05/03/2019 12:12:12")))