summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2014-11-07 12:15:04 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2014-11-07 12:15:04 +0100
commitf89b069d7e88a2b0959d0653ffc4d9594d99f58b (patch)
tree7b2f63f49e6d39ef2904b3fe04df01adf6c5fc3a /tex
parenta7cca389be5c9314510fa022c2c2e34c76ed76f8 (diff)
downloadcontext-f89b069d7e88a2b0959d0653ffc4d9594d99f58b.tar.gz
2014-11-07 11:50:00
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/buff-ver.lua28
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4385 -> 4392 bytes
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/mult-def.mkiv1
-rw-r--r--tex/context/base/publ-dat.lua47
-rw-r--r--tex/context/base/publ-ini.lua13
-rw-r--r--tex/context/base/publ-ini.mkiv83
-rw-r--r--tex/context/base/publ-tra.mkiv34
-rw-r--r--tex/context/base/status-files.pdfbin24700 -> 24702 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin333279 -> 333281 bytes
-rw-r--r--tex/context/base/strc-lst.lua5
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
13 files changed, 110 insertions, 107 deletions
diff --git a/tex/context/base/buff-ver.lua b/tex/context/base/buff-ver.lua
index bc8ea6597..832c14122 100644
--- a/tex/context/base/buff-ver.lua
+++ b/tex/context/base/buff-ver.lua
@@ -739,24 +739,30 @@ end
-- match but slower when there is no match. But anyway, we need a more clever
-- parser so we use lpeg.
--
--- [[\text ]] [[\text{}]] [[\text \text ]] [[\text \\ \text ]]
+-- [[\text ]] [[\text{}]] [[\foo\bar .tex]] [[\text \text ]] [[\text \\ \text ]]
--
-- needed in e.g. tabulate (manuals)
-local compact_all = Cs((P("\\") * ((1-S("\\ "))^1) * (P(" ")/"") * (P(-1) + S("[{")) + 1)^0)
-local compact_absolute = Cs((P("\\") * ((1-S("\\ [{.,-_"))^1) * (P(" ")/"" * (S("[{\\.,-_"))) + 1) ^0)
-local compact_last = Cs((P(" ")^1 * P(-1)/"" + 1)^0)
+local fences = S([[[{]])
+local symbols = S([[!#"$%&'*()+,-./:;<=>?@[]^_`{|}~]])
+local space = S([[ ]])
+local backslash = S([[\]])
+local nospace = space^1/""
+local endstring = P(-1)
+
+local compactors = {
+ [v_all] = Cs((backslash * (1-backslash-space)^1 * nospace * (endstring + fences) + 1)^0),
+ [v_absolute] = Cs((backslash * (1-symbols -space)^1 * nospace * (symbols+backslash) + 1) ^0),
+ [v_last] = Cs((space^1 * endstring/"" + 1)^0),
+}
function commands.typestring(settings)
local content = settings.data
if content and content ~= "" then
- local compact = settings.compact
- if compact == v_all then
- content = lpegmatch(compact_all,content)
- elseif compact == v_absolute then
- content = lpegmatch(compact_absolute,content)
- elseif compact == v_last then
- content = lpegmatch(compact_last,content)
+ 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)
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index 2ab225435..80bdb4c4d 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.11.06 23:46}
+\newcontextversion{2014.11.07 11:48}
%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 c6ba98466..2a1cac81e 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 52bc6f378..aff8f8240 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.11.06 23:46}
+\edef\contextversion{2014.11.07 11:48}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/mult-def.mkiv b/tex/context/base/mult-def.mkiv
index 5bccd8cca..560faf6e0 100644
--- a/tex/context/base/mult-def.mkiv
+++ b/tex/context/base/mult-def.mkiv
@@ -78,6 +78,7 @@
\def\c!register {register}
\def\c!field {field}
\def\c!ignore {ignore}
+\def\c!specification {specification}
\def\c!pageleft {pageleft}
\def\c!pageright {pageright}
diff --git a/tex/context/base/publ-dat.lua b/tex/context/base/publ-dat.lua
index b801e3b30..834fdc10c 100644
--- a/tex/context/base/publ-dat.lua
+++ b/tex/context/base/publ-dat.lua
@@ -115,7 +115,7 @@ local separator = space * "+" * space
local l_splitter = lpeg.tsplitat(separator)
local d_splitter = lpeg.splitat (separator)
-local extrafields = {
+local implicitfields = {
category = "implicit",
tag = "implicit",
key = "implicit",
@@ -124,17 +124,34 @@ local extrafields = {
crossref = "implicit",
}
-local unknowncategory = function(t,k)
- local v = {
- required = { },
- optional = { },
- }
+local types = {
+ "optional",
+ "extra",
+ "required",
+ "virtual",
+}
+
+local virtuals = {
+ "authoryear",
+ "authoryears",
+ "authornum",
+ "num",
+ "suffix",
+}
+
+local unknownfield = function(t,k)
+ local v = "extra"
t[k] = v
return v
end
-local unknownfield = function(t,k)
- local v = setmetatableindex(function(t,k) local v = "optional" t[k] = v return v end)
+local unknowncategory = function(t,k)
+ local v = {
+ required = false,
+ optional = false,
+ virtual = false,
+ fields = setmetatableindex(unknownfield),
+ }
t[k] = v
return v
end
@@ -146,19 +163,13 @@ local default = {
author = "anonymous",
copyright = "no one",
categories = setmetatableindex(unknowncategory),
- fields = setmetatableindex(unknownfield),
}
-local types = { "optional", "required", "virtual" }
-local virtuals = { "authoryear", "authoryears", "authornum", "num", "suffix" } -- defaults
-
local function checkfield(specification,category,data)
- local fields = specification.fields
- local list = setmetatableindex({},extrafields)
- fields[category] = list
- data.fields = list
- data.category = category
- local sets = data.sets or { }
+ local list = setmetatableindex({},implicitfields)
+ data.fields = list
+ data.category = category
+ local sets = data.sets or { }
if data.virtual == nil then -- so false is valid
data.virtual = specification.virtual
end
diff --git a/tex/context/base/publ-ini.lua b/tex/context/base/publ-ini.lua
index 78c50677b..367a192f7 100644
--- a/tex/context/base/publ-ini.lua
+++ b/tex/context/base/publ-ini.lua
@@ -883,6 +883,15 @@ end
do
+ -- if there is no specification then we're in trouble but there is
+ -- always a default anyway
+ --
+ -- there's also always a fields table but it can be empty due to
+ -- lack of specifications
+ --
+ -- then there can be cases where we have no specification for instance
+ -- when we have a special kind of database
+
local function permitted(category,field)
local catspec = currentspecificationcategories[category]
if not catspec then
@@ -895,7 +904,8 @@ do
return false
end
local kind = fields[field]
- if ignoredfields and kind == "optional" and ignoredfields[field] then
+ -- if ignoredfields and kind == "optional" and ignoredfields[field] then
+ if ignoredfields and ignoredfields[field] then
return false
else
local sets = catspec.sets
@@ -1036,7 +1046,6 @@ do
local category = fields.category
local valid = permitted(category,field)
if valid then
--- print("!!!!!!",found(dataset,tag,field,valid,fields))
return found(dataset,tag,field,valid,fields)
end
end
diff --git a/tex/context/base/publ-ini.mkiv b/tex/context/base/publ-ini.mkiv
index ddf922cf6..7c8676c4b 100644
--- a/tex/context/base/publ-ini.mkiv
+++ b/tex/context/base/publ-ini.mkiv
@@ -95,9 +95,6 @@
\installsimplecommandhandler \??btx {btx} \??btx
-% \setupbtx
-% [\c!alternative=apa]
-
% \newconstant\btxmode
% \newconstant\btxnonemode
% \newconstant\btxcitemode
@@ -106,7 +103,7 @@
%D Loading variants:
\let\currentbtxrenderingdefinition\empty
-\let\currentbtxalternative \empty
+\let\currentbtxspecification \empty
\unexpanded\def\startbtxrenderingdefinitions[#1]%
{\pushmacro\currentbtxrenderingdefinition
@@ -120,19 +117,15 @@
{\ctxcommand{loadbtxdefinitionfile("#1")}}
\appendtoks
- \edef\currentbtxalternative{\btxparameter\c!alternative}%
- \ifcsname\??btxrenderingdefinition\currentbtxalternative\endcsname
+ \edef\currentbtxspecification{\btxparameter\c!specification}%
+ \ifcsname\??btxrenderingdefinition\currentbtxspecification\endcsname
% maybe fall back on apa ?
\else
- \loadbtxdefinitionfile[\currentbtxalternative]%
- \showmessage\m!publications{14}{\currentbtxalternative}%
+ \loadbtxdefinitionfile[\currentbtxspecification]%
+ \showmessage\m!publications{14}{\currentbtxspecification}%
\fi
\to \everysetupbtx
-\def\btx_set_rendering_alternative
- {\edef\currentbtxalternative{\btxparameter\c!alternative}%
- \ctxcommand{setbtxspecification("\currentbtxalternative")}}
-
% a dedicated construction mechanism
\installcorenamespace {btxlist}
@@ -637,7 +630,7 @@
{\begingroup
\edef\currentbtxcategory{\btxfield{category}}%
\ignorespaces
- \edef\currentbtxsetup{\s!btx:\currentbtxalternative:\currentbtxcategory}%
+ \edef\currentbtxsetup{\s!btx:\currentbtxspecification:\currentbtxcategory}%
\doifsetupselse\currentbtxsetup
\btx_entry_inject_yes
\btx_entry_inject_nop
@@ -667,7 +660,7 @@
{\begingroup
\def\currentbtxtag{#1}%
\ignorespaces
- \fastsetup{\s!btx:\currentbtxalternative:\currentbtxcategory}%
+ \fastsetup{\s!btx:\currentbtxspecification:\currentbtxcategory}%
\removeunwantedspaces
\endgroup}
@@ -734,7 +727,8 @@
{\startbtxrendering[\currentbtxrendering]%
% \fastsetup{\btxrenderingparameter\c!setups}% specific initializations
% \determinelistcharacteristics[\currentbtxrendering]%
- \btx_set_rendering_alternative
+ \edef\currentbtxspecification{\btxrenderingparameter\c!specification}%
+ \ctxcommand{setbtxspecification("\currentbtxspecification")}%
\edef\currentbtxdataset{\btxrenderingparameter\c!dataset}%
\uselanguageparameter\btxdatasetparameter % new
\let\currentlist\s!btx
@@ -1262,44 +1256,13 @@
%D In-text entries:
-% \unexpanded\def\placecitation
-% {\dodoubleempty\publ_place_citation}
-%
-% \unexpanded\def\publ_place_citation
-% {\ifsecondargument
-% \expandafter\publ_place_citation_two
-% \else\iffirstargument
-% \doubleexpandafter\publ_place_citation_one
-% \else
-% \doubleexpandafter\publ_place_citation_zero
-% \fi\fi}
-%
-% \unexpanded\def\publ_place_citation_one[#1][#2]%
-% {\publ_place_citation_two[\currentbtxrendering][#1]}
-%
-% \unexpanded\def\publ_place_citation_two[#1][#2]%
-% {\dontleavehmode
-% \begingroup
-% \startbtxrendering[#1]%
-% \btx_set_rendering_alternative
-% \edef\currentbtxdataset{\btxrenderingparameter\c!dataset}%
-% \uselanguageparameter\btxdatasetparameter % new
-% \ctxcommand{btxflushlistentry{ dataset = "\currentbtxdataset", reference = \!!bs#2\!!es }}%
-% \btxcitereference % we need a proper setup
-% \stopbtxrendering
-% \endgroup}
-%
-% \unexpanded\def\publ_place_citation_zero[#1][#2]%
-% {\btxmissing{??}}
-%
-% \let\btxhandlelisttextentry\btx_entry_inject
-
\unexpanded\def\placecitation{\citation[entry]} % [#1]
\unexpanded\def\btxhandleciteentry
{\dontleavehmode
\begingroup
- \btx_set_rendering_alternative
+ \edef\currentbtxspecification{\btxcitevariantparameter\c!specification}%
+ \ctxcommand{setbtxspecification("\currentbtxspecification")}%
\btxcitereference
\btx_entry_inject
\endgroup}
@@ -1374,7 +1337,8 @@
[\v!standard]
\setupbtxrendering
- [\c!dataset=\v!standard,
+ [\c!specification=\btxparameter\c!specification,
+ \c!dataset=\v!standard,
\c!repeat=\v!no,
\c!continue=\v!no,
\c!method=\v!global,
@@ -1397,10 +1361,10 @@
\setupbtxlistvariant
[\c!namesep={,\space},
- \c!lastnamesep={,\space\btxlabeltext{\currentbtxalternative:and}\space},
- \c!finalnamesep={,\space\btxlabeltext{\currentbtxalternative:and}\space},
+ \c!lastnamesep={,\space\btxlabeltext{\currentbtxspecification:and}\space},
+ \c!finalnamesep={,\space\btxlabeltext{\currentbtxspecification:and}\space},
\c!firstnamesep=\space,
- \c!otherstext={\space\btxlabeltext{\currentbtxalternative:others}},
+ \c!otherstext={\space\btxlabeltext{\currentbtxspecification:others}},
\c!juniorsep=\space,
\c!vonsep=\space,
\c!initialsep=\space, % between initials and lastname
@@ -1423,11 +1387,12 @@
[author]
\setupbtxcitevariant
- [\c!namesep={,\space},
- \c!lastnamesep={,\space\btxlabeltext{\currentbtxalternative:and}\space},
- \c!finalnamesep={,\space\btxlabeltext{\currentbtxalternative:and}\space},
+ [\c!specification=\btxparameter\c!specification,
+ \c!namesep={,\space},
+ \c!lastnamesep={,\space\btxlabeltext{\currentbtxspecification:and}\space},
+ \c!finalnamesep={,\space\btxlabeltext{\currentbtxspecification:and}\space},
\c!firstnamesep=\space,
- \c!otherstext={\space\btxlabeltext{\currentbtxalternative:others}},
+ \c!otherstext={\space\btxlabeltext{\currentbtxspecification:others}},
\c!juniorsep=\space,
\c!vonsep=\space,
\c!initialsep=\space,
@@ -1444,8 +1409,8 @@
% \c!setups=btx:cite:initialize,
\c!alternative=num,
\c!pubsep={,\space},
- \c!lastpubsep={\space\btxlabeltext{\currentbtxalternative:and}\space},
- \c!finalpubsep={\space\btxlabeltext{\currentbtxalternative:and}\space},
+ \c!lastpubsep={\space\btxlabeltext{\currentbtxspecification:and}\space},
+ \c!finalpubsep={\space\btxlabeltext{\currentbtxspecification:and}\space},
\c!sorttype=,
\c!compress=\v!no,
\c!inbetween=\space,
@@ -1584,7 +1549,7 @@
\loadbtxdefinitionfile[author]
\setupbtx
- [\c!alternative=apa]
+ [\c!specification=apa]
% \letvalue{\??btxrenderingdefinition apa}\undefined % we will reload at runtime
diff --git a/tex/context/base/publ-tra.mkiv b/tex/context/base/publ-tra.mkiv
index 281b16ae0..a1281ca23 100644
--- a/tex/context/base/publ-tra.mkiv
+++ b/tex/context/base/publ-tra.mkiv
@@ -24,30 +24,36 @@
\unexpanded\def\showbtxdatasetcompleteness{\dosingleempty\publ_show_dataset_completeness}
\unexpanded\def\showbtxfields {\dosingleempty\publ_show_fields}
-\def\publ_show_dataset_fields[#1]%
+\def\publ_show_dataset_whatever#1[#2]%
{\begingroup
- \getdummyparameters[\c!type=apa,\c!dataset=\currentbtxdataset,#1]%
- \ctxcommand{showbtxdatasetfields{
+ \setdummyparameter\c!specification{\btxparameter\c!specification}%
+ \setdummyparameter\c!dataset {\currentbtxdataset}%
+ \iffirstargument
+ \doifassignmentelse{#2}
+ {\getdummyparameters[#2]}%
+ {\setdummyparameter\c!dataset{#2}}%
+ \else
+ \getdummyparameters[#2]%
+ \fi
+ \ctxcommand{#1{
dataset = "\dummyparameter\c!dataset",
- kind = "\dummyparameter\c!type"
+ kind = "\dummyparameter\c!specification"
}}%
\endgroup}
-\def\publ_show_dataset_completeness[#1]%
- {\begingroup
- \getdummyparameters[\c!type=apa,\c!dataset=\currentbtxdataset,#1]%
- \ctxcommand{showbtxdatasetcompleteness{
- dataset = "\dummyparameter\c!dataset",
- kind = "\dummyparameter\c!type"
- }}%
- \endgroup}
+\def\publ_show_dataset_fields {\publ_show_dataset_whatever{showbtxdatasetfields}}
+\def\publ_show_dataset_completeness{\publ_show_dataset_whatever{showbtxdatasetcompleteness}}
\def\publ_show_fields[#1]%
{\begingroup
- \getdummyparameters[\c!type=apa,#1]%
+ \setdummyparameter\c!rotation{90}%
+ \doifassignmentelse{#1}
+ {\setdummyparameter\c!specification{\btxparameter\c!specification}%
+ \getdummyparameters[#1]}%
+ {\setdummyparameter\c!specification{#1}}%
\ctxcommand{showbtxfields{
rotation = "\dummyparameter\c!rotation",
- kind = "\dummyparameter\c!type"
+ kind = "\dummyparameter\c!specification"
}}%
\endgroup}
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index b0ee40cc2..7d895512c 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 784d658f4..8dd64b96e 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/strc-lst.lua b/tex/context/base/strc-lst.lua
index 02a7e6d29..addc7f117 100644
--- a/tex/context/base/strc-lst.lua
+++ b/tex/context/base/strc-lst.lua
@@ -377,6 +377,7 @@ local function filtercollected(specification)
specification.numbers = numbers
specification.depth = depth
specification.block = block
+ specification.all = all
--
if trace_lists then
report_lists("filtering names %,t, criterium %a, block %a",sortedkeys(names), criterium, block or "*")
@@ -640,10 +641,14 @@ filters[v_local] = function(specification)
elseif autosectiondepth(numbers) == 0 then
specification.nested = false
specification.criterium = v_all
+ -- return filtercollected(specification) -- rechecks, so better
+ specification.all = true
+ specification.block = false
return filters[v_all](specification)
else
specification.nested = false
specification.criterium = v_current
+ -- return filtercollected(specification) -- rechecks, so better
return filters[v_current](specification)
end
end
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 3c77d78c7..c69c70e14 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 : 11/06/14 23:46:33
+-- merge date : 11/07/14 11:48:29
do -- begin closure to overcome local limits and interference