diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2014-01-14 13:21:20 +0100 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2014-01-14 13:21:20 +0100 |
commit | cbf1a28451ad42a7f8c2a9256810868f378e4631 (patch) | |
tree | b14244826ff599ca66bd624e90c5b4fe1ce77e40 | |
parent | 6232768122e63018a69bfd6159514b60020b75bb (diff) | |
download | luaotfload-cbf1a28451ad42a7f8c2a9256810868f378e4631.tar.gz |
[db,tool,diagnose,parsers] move miscellaneous patterns into luaotfload-parsers
-rw-r--r-- | luaotfload-database.lua | 17 | ||||
-rw-r--r-- | luaotfload-diagnostics.lua | 8 | ||||
-rw-r--r-- | luaotfload-parsers.lua | 20 | ||||
-rwxr-xr-x | luaotfload-tool.lua | 4 |
4 files changed, 30 insertions, 19 deletions
diff --git a/luaotfload-database.lua b/luaotfload-database.lua index 32197cc..762e853 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -44,7 +44,10 @@ local P, R, S, lpegmatch local C, Cc, Cf, Cg, Cs, Ct = lpeg.C, lpeg.Cc, lpeg.Cf, lpeg.Cg, lpeg.Cs, lpeg.Ct -local read_fonts_conf = luaotfload.parsers.read_fonts_conf +local parsers = luaotfload.parsers +local read_fonts_conf = parsers.read_fonts_conf +local stripslashes = parsers.stripslashes +local splitcomma = parsers.splitcomma --- Luatex builtins local load = load @@ -183,18 +186,6 @@ if not luaotfloadconfig.termwidth then luaotfloadconfig.termwidth = tw end -names.patterns = { } -local patterns = names.patterns - -local trailingslashes = P"/"^1 * P(-1) -local stripslashes = C((1 - trailingslashes)^0) -patterns.stripslashes = stripslashes - -local comma = P"," -local noncomma = 1-comma -local splitcomma = Ct((C(noncomma^1) + comma)^1) -patterns.splitcomma = splitcomma - local format_precedence = { "otf", "ttc", "ttf", "dfont", "afm", "pfb", diff --git a/luaotfload-diagnostics.lua b/luaotfload-diagnostics.lua index 1f29e3d..1ae9a90 100644 --- a/luaotfload-diagnostics.lua +++ b/luaotfload-diagnostics.lua @@ -53,6 +53,10 @@ local out = function (...) logs.names_report (false, 0, "diagnose", ...) end +local parsers = luaotfload.parsers +local stripslashes = parsers.stripslashes +local splitcomma = parsers.splitcomma + local check_index = function (errcnt) out "================= font names ==================" @@ -163,8 +167,6 @@ local analyze_permissions = function (raw) return lpegmatch (p_permissions, raw) end -local stripslashes = names.patterns.stripslashes - local get_permissions = function (t, location) if stringsub (location, #location) == "/" then --- strip trailing slashes (lfs idiosyncrasy on Win) @@ -605,8 +607,6 @@ local anamneses = { "permissions" } -local splitcomma = names.patterns.splitcomma - local diagnose = function (job) local errcnt = 0 local asked = job.asked_diagnostics diff --git a/luaotfload-parsers.lua b/luaotfload-parsers.lua index 89e3bc9..0789c42 100644 --- a/luaotfload-parsers.lua +++ b/luaotfload-parsers.lua @@ -49,6 +49,10 @@ local lfs = lfs local lfsisfile = lfs.isfile local lfsisdir = lfs.isdir +------------------------------------------------------------------------------- +--- FONTCONFIG +------------------------------------------------------------------------------- + --[[doc-- For fonts installed on the operating system, there are several @@ -296,3 +300,19 @@ end luaotfload.parsers.read_fonts_conf = read_fonts_conf + +------------------------------------------------------------------------------- +--- MISC PARSERS +------------------------------------------------------------------------------- + + +local trailingslashes = P"/"^1 * P(-1) +local stripslashes = C((1 - trailingslashes)^0) +parsers.stripslashes = stripslashes + +local comma = P"," +local noncomma = 1-comma +local splitcomma = Ct((C(noncomma^1) + comma)^1) +parsers.splitcomma = splitcomma + + diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index 18e9f9e..32086e1 100755 --- a/luaotfload-tool.lua +++ b/luaotfload-tool.lua @@ -6,7 +6,7 @@ -- AUTHOR: Khaled Hosny, Élie Roux, Philipp Gesang -- VERSION: 2.5 -- LICENSE: GPL v2.0 --- MODIFIED: 2014-01-02 21:21:10+0100 +-- MODIFIED: 2014-01-14 13:17:04+0100 ----------------------------------------------------------------------- local version = "2.5" --- <int: major>.<int: minor><alpha: fixes> @@ -950,7 +950,7 @@ set_primary_field = function (fields, addme, acc, n) return acc end -local splitcomma = names.patterns.splitcomma +local splitcomma = luaotfload.parsers.splitcomma actions.list = function (job) local criterion = job.criterion |