summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/publ-dat.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2016-11-01 11:41:49 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-11-01 11:41:49 +0100
commit5a501d72ddc9ab9003746aa46fad3a12046e20ec (patch)
tree961dfe1070db46aa798ec0dc553f19b60f8355c6 /tex/context/base/mkiv/publ-dat.lua
parentf0bc9c17c5298a3a4645f28a39273f52c27c646a (diff)
downloadcontext-5a501d72ddc9ab9003746aa46fad3a12046e20ec.tar.gz
2016-11-01 10:15:00
Diffstat (limited to 'tex/context/base/mkiv/publ-dat.lua')
-rw-r--r--tex/context/base/mkiv/publ-dat.lua31
1 files changed, 20 insertions, 11 deletions
diff --git a/tex/context/base/mkiv/publ-dat.lua b/tex/context/base/mkiv/publ-dat.lua
index 98bff25e6..5fc1031cd 100644
--- a/tex/context/base/mkiv/publ-dat.lua
+++ b/tex/context/base/mkiv/publ-dat.lua
@@ -578,8 +578,18 @@ do
local p_left = (p_whitespace^0 * left) / ""
local p_right = (right * p_whitespace^0) / ""
+ local keyword = C((R("az","AZ","09") + S("@_:-"))^1)
+ local key = C((1-space-equal)^1)
+ local tag = C((1-space-comma)^0)
+ local category = C((1-space-left)^1)
+ local s_quoted = ((escape*single) + collapsed + (1-single))^0
+ local d_quoted = ((escape*double) + collapsed + (1-double))^0
+
+ local reference = P("@{") * C((R("az","AZ","09") + S("_:-"))^1) * P("}")
+ local r_value = reference * Carg(1) / resolve
+
local balanced = P {
- [1] = ((escape * (left+right)) + (collapsed + 1 - (left+right))^1 + V(2))^0,
+ [1] = ((escape * (left+right)) + (collapsed + r_value + 1 - (left+right))^1 + V(2))^0,
[2] = left * V(1) * right,
}
@@ -590,26 +600,22 @@ do
local unbalanced = (left/"") * balanced * (right/"") * P(-1)
- local keyword = C((R("az","AZ","09") + S("@_:-"))^1)
- local key = C((1-space-equal)^1)
- local tag = C((1-space-comma)^0)
- local reference = keyword
- local category = C((1-space-left)^1)
- local s_quoted = ((escape*single) + collapsed + (1-single))^0
- local d_quoted = ((escape*double) + collapsed + (1-double))^0
-
+ local reference = P("@") * C((R("az","AZ","09") + S("_:-"))^1)
local b_value = p_left * balanced * p_right
-- local u_value = p_left * unbalanced * p_right -- get rid of outer { }
-- local s_value = (single/"") * (u_value + s_quoted) * (single/"")
-- local d_value = (double/"") * (u_value + d_quoted) * (double/"")
local s_value = (single/"") * (unbalanced + s_quoted) * (single/"")
local d_value = (double/"") * (unbalanced + d_quoted) * (double/"")
- local r_value = reference * Carg(1) /resolve
+ local r_value = reference * Carg(1) / resolve
local somevalue = d_value + b_value + s_value + r_value
local value = Cs((somevalue * ((spacing * hash * spacing)/"" * somevalue)^0))
- value = value / function(s) return lpegmatch(lpegpatterns.stripper,s) end
+ local stripper = lpegpatterns.stripper
+ value = value / function(s)
+ return lpegmatch(stripper,s)
+ end
local forget = percent^1 * (1-lineending)^0
local spacing = spacing * forget^0 * spacing
@@ -632,6 +638,9 @@ do
-- converttoxml -> dataset.xmldata from dataset.luadata
+ -- author = "al-" # @AHSAI # "," # @SHAYKH # " " # @AHMAD # " Ibn " # @ZAYNIDDIN
+ -- author = {al-@{AHSAI}, @{SHAYKH} @{AHMAD} Ibn @{ZAYNIDDIN}}
+
function publications.loadbibdata(dataset,content,source,kind)
if not source then
report("invalid source for dataset %a",dataset)