summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2014-01-20 11:31:00 +0100
committerHans Hagen <pragma@wxs.nl>2014-01-20 11:31:00 +0100
commit70ebf085020199253095bcf11ca35f57fea5299a (patch)
treef2360ccc374cb31c94dce01ca48b23bce9a748cb /tex
parent8032dd69bf673d8a4a75a1cba0b151104a5939df (diff)
downloadcontext-70ebf085020199253095bcf11ca35f57fea5299a.tar.gz
beta 2014.01.20 11:31
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4093 -> 4088 bytes
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/node-res.lua13
-rw-r--r--tex/context/base/publ-dat.lua34
-rw-r--r--tex/context/base/publ-ini.lua16
-rw-r--r--tex/context/base/spac-ver.lua25
-rw-r--r--tex/context/base/status-files.pdfbin24775 -> 24772 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin229268 -> 229139 bytes
-rw-r--r--tex/context/base/trac-tim.lua2
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
11 files changed, 56 insertions, 40 deletions
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index 2f5668663..886556d81 100644
--- a/tex/context/base/cont-new.mkiv
+++ b/tex/context/base/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2014.01.19 16:44}
+\newcontextversion{2014.01.20 11:31}
%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/context-version.pdf b/tex/context/base/context-version.pdf
index 46c672325..fd721fd46 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index 85f99f501..0787ae987 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -28,7 +28,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2014.01.19 16:44}
+\edef\contextversion{2014.01.20 11:31}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/node-res.lua b/tex/context/base/node-res.lua
index 709532d76..968283745 100644
--- a/tex/context/base/node-res.lua
+++ b/tex/context/base/node-res.lua
@@ -159,13 +159,12 @@ local vlist = register_nut(new_nut("vlist")) setfield(vlist,"dir","T
function nutpool.zeroglue(n)
local s = getfield(n,"spec")
- return not writable or ( -- still valid? writable
- getfield(s,"width") == 0
- and getfield(s,"stretch") == 0
- and getfield(s,"shrink") == 0
- and getfield(s,"stretch_order") == 0
- and getfield(s,"shrink_order") == 0
- )
+ return
+ getfield(s,"width") == 0 and
+ getfield(s,"stretch") == 0 and
+ getfield(s,"shrink") == 0 and
+ getfield(s,"stretch_order") == 0 and
+ getfield(s,"shrink_order") == 0
end
function nutpool.glyph(fnt,chr)
diff --git a/tex/context/base/publ-dat.lua b/tex/context/base/publ-dat.lua
index 8b59b1dee..20fada411 100644
--- a/tex/context/base/publ-dat.lua
+++ b/tex/context/base/publ-dat.lua
@@ -126,8 +126,11 @@ end)
-- we apply some normalization
+local space = S(" \t\n\r\f") -- / " "
+
----- command = P("\\") * Cc("btxcmd{") * (R("az","AZ")^1) * Cc("}")
-local command = P("\\") * (Carg(1) * C(R("az","AZ")^1) / function(list,c) list[c] = (list[c] or 0) + 1 return "btxcmd{" .. c .. "}" end)
+----- command = P("\\") * (Carg(1) * C(R("az","AZ")^1) / function(list,c) list[c] = (list[c] or 0) + 1 return "btxcmd{" .. c .. "}" end)
+local command = P("\\") * (Carg(1) * C(R("az","AZ")^1) * space^0 / function(list,c) list[c] = (list[c] or 0) + 1 return "btxcmd{" .. c .. "}" end)
local somemath = P("$") * ((1-P("$"))^1) * P("$") -- let's not assume nested math
local any = P(1)
local done = P(-1)
@@ -150,14 +153,6 @@ local filter_2 = Cs(
-- in tugboat.bib this is not that efficient. However, eventually strings get
-- hashed again.
--- local function do_shortcut(tag,key,value,dataset)
--- publicationsstats.nofshortcuts = publicationsstats.nofshortcuts + 1
--- tag = lowercase(tag)
--- if tag == "@string" then
--- dataset.shortcuts[key] = value
--- end
--- end
-
local function do_shortcut(key,value,dataset)
publicationsstats.nofshortcuts = publicationsstats.nofshortcuts + 1
dataset.shortcuts[key] = value
@@ -176,6 +171,9 @@ end
publications.getindex = getindex
+-- todo: categories : metatable that lowers and also counts
+-- todo: fields : metatable that lowers
+
local function do_definition(category,tag,tab,dataset)
publicationsstats.nofdefinitions = publicationsstats.nofdefinitions + 1
local fields = dataset.fields
@@ -183,7 +181,7 @@ local function do_definition(category,tag,tab,dataset)
local found = luadata[tag]
local index = getindex(dataset,luadata,tag)
local entries = {
- category = gsub(lower(category),"^@",""),
+ category = lower(category),
tag = tag,
index = index,
}
@@ -239,29 +237,31 @@ local balanced = P {
[2] = left * V(1) * right
}
-local keyword = C((R("az","AZ","09") + S("@_:-"))^1) -- C((1-space)^1)
+local keyword = C((R("az","AZ","09") + S("@_:-"))^1)
+local key = C((1-space-equal)^1)
+local tag = C((1-space-comma)^1)
+local reference = keyword
+local category = P("@") * C((1-space-left)^1)
local s_quoted = ((escape*single) + collapsed + (1-single))^0
local d_quoted = ((escape*double) + collapsed + (1-double))^0
local b_value = (left /"") * balanced * (right /"")
local s_value = (single/"") * (b_value + s_quoted) * (single/"")
local d_value = (double/"") * (b_value + d_quoted) * (double/"")
-local r_value = keyword * Carg(1) /resolve
+local r_value = reference * Carg(1) /resolve
local somevalue = s_value + d_value + b_value + r_value
local value = Cs((somevalue * ((spacing * hash * spacing)/"" * somevalue)^0))
-local assignment = spacing * keyword * spacing * equal * spacing * value * spacing
------ shortcut = keyword * spacing * left * spacing * (assignment * comma^0)^0 * spacing * right * Carg(1)
+local assignment = spacing * key * spacing * equal * spacing * value * spacing
local shortcut = P("@") * (P("string") + P("STRING")) * spacing * left * ((assignment * Carg(1))/do_shortcut * comma^0)^0 * spacing * right
-local definition = keyword * spacing * left * spacing * keyword * comma * Ct((assignment * comma^0)^0) * spacing * right * Carg(1)
+local definition = category * spacing * left * spacing * tag * spacing * comma * Ct((assignment * comma^0)^0) * spacing * right * Carg(1) / do_definition
local comment = keyword * spacing * left * (1-right)^0 * spacing * right
local forget = percent^1 * (1-lineending)^0
-- todo \%
--- local bibtotable = (space + forget + shortcut/do_shortcut + definition/do_definition + comment + 1)^0
-local bibtotable = (space + forget + shortcut + definition/do_definition + comment + 1)^0
+local bibtotable = (space + forget + shortcut + definition + comment + 1)^0
-- loadbibdata -> dataset.luadata
-- loadtexdata -> dataset.luadata
diff --git a/tex/context/base/publ-ini.lua b/tex/context/base/publ-ini.lua
index ff5963173..9cb5fe0f4 100644
--- a/tex/context/base/publ-ini.lua
+++ b/tex/context/base/publ-ini.lua
@@ -853,8 +853,8 @@ end
-- rendering ?
-local f_reference = formatters["r:%s:%s:%s"] -- dataset, instance, tag
-local f_destination = formatters["d:%s:%s:%s"] -- dataset, instance, tag
+local f_reference = formatters["r:%s:%s:%s"] -- dataset, instance (block), tag
+local f_destination = formatters["d:%s:%s:%s"] -- dataset, instance (block), tag
function lists.resolve(dataset,reference) -- maybe already feed it split
-- needs checking (the prefix in relation to components)
@@ -879,6 +879,7 @@ function lists.resolve(dataset,reference) -- maybe already feed it split
end
end
end
+-- inspect(subsets)
if #subsets > 0 then
local result, nofresult, done = { }, 0, { }
for i=1,#subsets do
@@ -890,7 +891,8 @@ function lists.resolve(dataset,reference) -- maybe already feed it split
found = subset[tag]
if not found then
for i=block-1,1,-1 do
- tag = i .. ":" .. rest
+ tag = f_destination(dataset,blk,rest)
+-- tag = i .. ":" .. rest
found = subset[tag]
if found then
blk = i
@@ -952,6 +954,9 @@ function lists.resolve(dataset,reference) -- maybe already feed it split
end
end
if nofcollected > 0 then
+-- inspect(reference)
+-- inspect(result)
+-- inspect(collected)
for i=1,nofcollected do
local c = collected[i]
if i == nofcollected then
@@ -982,6 +987,7 @@ function commands.btxreference(dataset,block,tag,data)
local ref = f_reference(dataset,block,tag)
if not done[ref] then
done[ref] = true
+-- context("<%s>",data)
ctx_dodirectfullreference(ref,data)
end
end
@@ -992,6 +998,7 @@ function commands.btxdestination(dataset,block,tag,data)
local ref = f_destination(dataset,block,tag)
if not done[ref] then
done[ref] = true
+-- context("<<%s>>",data)
ctx_dodirectfullreference(ref,data)
end
end
@@ -1221,7 +1228,8 @@ function citevariants.page(dataset,tags)
end
function citevariants.num(dataset,tags)
- lists.resolve(dataset,tags)
+-- ctx_btxdirectlink(f_destination(dataset,block,tags),listindex) -- not okay yet
+ lists.resolve(dataset,tags)
end
function citevariants.serial(dataset,tags) -- the traditional fieldname is "serial" and not "index"
diff --git a/tex/context/base/spac-ver.lua b/tex/context/base/spac-ver.lua
index 960180dc2..66d7ca642 100644
--- a/tex/context/base/spac-ver.lua
+++ b/tex/context/base/spac-ver.lua
@@ -765,7 +765,16 @@ local belowdisplayshortskip_code = skipcodes.belowdisplayshortskip
local topskip_code = skipcodes.topskip
local splittopskip_code = skipcodes.splittopskip
+-- local function free_glue_node(n)
+-- free_node(n)
+-- local s = getfield(n,"spec")
+-- if s then
+-- free_node(s)
+-- end
+-- end
+
local free_glue_node = free_node
+local free_glue_spec = free_node
function vspacing.snapbox(n,how)
local sv = snapmethods[how]
@@ -980,14 +989,13 @@ local function collapser(head,where,what,trace,snap,a_snapmethod) -- maybe also
local so = getattr(current,a_skiporder) or 1 -- has 1 default, no unset (yet)
local sp = getattr(current,a_skippenalty) -- has no default, no unset (yet)
if sp and sc == penalty then
-
-if where == "page" and sp >= special_penalty_min and sp <= special_penalty_max then
- local previousspecial = specialpenalty(current,sp)
- if previousspecial then
- setfield(previousspecial,"penalty",0)
- sp = 0
- end
-end
+ if where == "page" and sp >= special_penalty_min and sp <= special_penalty_max then
+ local previousspecial = specialpenalty(current,sp)
+ if previousspecial then
+ setfield(previousspecial,"penalty",0)
+ sp = 0
+ end
+ end
if not penalty_data then
penalty_data = sp
elseif penalty_order < so then
@@ -1016,6 +1024,7 @@ end
local cw, cp, cm = getfield(cs,"width"), getfield(cs,"stretch"), getfield(cs,"shrink")
-- ps = writable_spec(previous) -- no writable needed here
-- ps.width, ps.stretch, ps.shrink = pw + cw, pp + cp, pm + cm
+ free_glue_spec(ps)
setfield(previous,"spec",new_gluespec(pw + cw, pp + cp, pm + cm)) -- else topskip can disappear
if trace then trace_natural("removed",current) end
head, current = remove_node(head, current, true)
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index ea41e0226..a749e563f 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ
diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf
index f099c4741..de9ed3c93 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/trac-tim.lua b/tex/context/base/trac-tim.lua
index 15ac9bf1b..b4744291c 100644
--- a/tex/context/base/trac-tim.lua
+++ b/tex/context/base/trac-tim.lua
@@ -88,7 +88,7 @@ local function convert(name)
delta = factor/delta
end
for k=1,#s do
- s[k] = format("(%s,%s)",k,(s[k]-b)*delta)
+ s[k] = format("(%.3f,%.3f)",k,(s[k]-b)*delta)
end
paths[tagname] = concat(s,"--")
end
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index b30adf315..d5b21a678 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 01/19/14 16:44:51
+-- merge date : 01/20/14 11:31:50
do -- begin closure to overcome local limits and interference