summaryrefslogtreecommitdiff
path: root/luaotfload-parsers.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-01-14 13:21:20 +0100
committerPhilipp Gesang <phg42.2a@gmail.com>2014-01-14 13:21:20 +0100
commitcbf1a28451ad42a7f8c2a9256810868f378e4631 (patch)
treeb14244826ff599ca66bd624e90c5b4fe1ce77e40 /luaotfload-parsers.lua
parent6232768122e63018a69bfd6159514b60020b75bb (diff)
downloadluaotfload-cbf1a28451ad42a7f8c2a9256810868f378e4631.tar.gz
[db,tool,diagnose,parsers] move miscellaneous patterns into luaotfload-parsers
Diffstat (limited to 'luaotfload-parsers.lua')
-rw-r--r--luaotfload-parsers.lua20
1 files changed, 20 insertions, 0 deletions
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
+
+