summaryrefslogtreecommitdiff
path: root/tex/context/base/publ-fnd.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/publ-fnd.lua')
-rw-r--r--tex/context/base/publ-fnd.lua87
1 files changed, 0 insertions, 87 deletions
diff --git a/tex/context/base/publ-fnd.lua b/tex/context/base/publ-fnd.lua
index 909b102db..32d0c11be 100644
--- a/tex/context/base/publ-fnd.lua
+++ b/tex/context/base/publ-fnd.lua
@@ -45,93 +45,6 @@ local word = Cs(lpegpatterns.unquoted + lpegpatterns.argument + valid^1)
local simple = C(valid^1)
local number = C(valid^1)
------ f_string_key = formatters[" local s_%s = entry[%q] if s_%s then s_%s = lower(s_%s) end "]
------ f_number_key = formatters[" local n_%s = tonumber(entry[%q]) or 0"]
------ f_field_key = formatters[" local f_%s = entry[%q] or ''"]
-
--- getfuzzy(entry,%q,categories)
-
--- local f_string_key = formatters[" local s_%s = get(entry,%q)\n if s_%s then s_%s = lower(s_%s) end"]
--- local f_field_key = formatters[" local f_%s = get(entry,%q) or ''"]
--- local f_field_key_c = formatters[" local c_%s = get(entry,%q,categories) or ''"]
--- local f_number_key = formatters[" local n_%s = tonumber(get(entry,%q)) or 0"]
---
--- local f_string_match = formatters["(s_%s and find(s_%s,%q))"]
--- local f_number_match = formatters["(n_%s and n_%s >= %s and n_%s <= %s)"]
--- local f_field_match = formatters["f_%s"]
--- local f_field_match_c = formatters["c_%s"]
---
--- local f_all_match = formatters["anywhere(entry,%q)"]
-
--- topattern(lowercase(word)) : utflowercase + only *?
-
--- local match = ( (key + wildcard) * (colon/"") ) * word * Carg(1) / function(key,_,word,keys)
--- if key == "*" or key == "any" then
--- keys.anywhere = true
--- if word == "" or word == "*" then
--- return "true"
--- else
--- return f_all_match(topattern(lowercase(word)))
--- end
--- else
--- keys[key] = f_string_key(key,key,key,key,key)
--- return f_string_match(key,key,topattern(lowercase(word)))
--- end
--- end
---
--- local default = simple * Carg(1) / function(word,keys)
--- keys.anywhere = true
--- if word == "" or word == "*" then
--- return "true"
--- else
--- return f_all_match(topattern(lowercase(word)))
--- end
--- end
---
--- local range = key * (colon/"") * number * (dash/"") * number * Carg(1) / function(key,_,first,_,last,keys)
--- keys[key] = f_number_key(key,key)
--- return f_number_match(key,key,tonumber(first) or 0,key,tonumber(last) or 0)
--- end
---
--- local field = (P("field:")/"") * key * Carg(1) / function(_,key,keys)
--- keys[key] = f_field_key(key,key)
--- return f_field_match(key)
--- end
---
--- local cast = (P("cast:")/"") * key * Carg(1) / function(_,key,keys)
--- keys[key] = f_field_key_c(key,key)
--- return f_field_match_c(key)
--- end
---
--- local compare = C("==") + P("=")/"==" + P("!=")/"~=" + P("<>")/"~="
---
--- local b_match = lparent
--- local e_match = rparent * space^0 * (#P(-1) + P(",")/" or ") -- maybe also + -> and
--- local f_match = ((field + cast + range + match + space + compare + P(1))-e_match)^1
--- local p_match = b_match * default * e_match
--- + b_match * f_match * e_match
---
--- local pattern = Cs(Cc("(") * (P("match")/"" * space^0 * p_match)^1 * Cc(")"))
-
--- field contains fieldname:nonspaces|"whatever"|'whatever'|{whatever}
--- field exact fieldname=nonspaces|"whatever"|'whatever'|{whatever}
--- set contains [fieldname]:nonspaces|"whatever"|'whatever'|{whatever}
--- set exact [fieldname]=nonspaces|"whatever"|'whatever'|{whatever}
---
--- with * : any sequence
--- ? : one character
---
--- and match(),match() ... equivalent to () and ()
---
--- <123 444> : range
---
--- unquoted = field
--- [..] = set
---
--- () and or not
---
--- spaces are mandate (at least for now)
-
local key = C(R("az","AZ")^1)
local contains = S(":~")
local exact = P("=")