diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2016-02-19 08:10:26 +0100 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2016-02-19 08:10:38 +0100 |
commit | 128b005cd8b44483ce2a58bd0cf078318663c696 (patch) | |
tree | 993cbe9c434729dea299d27bfb1831274cfbe2b9 | |
parent | 128b29a4260f0454996f5663a02c0f7c575b2d6b (diff) | |
download | luaotfload-128b005cd8b44483ce2a58bd0cf078318663c696.tar.gz |
[parsers] allow whitespace around combo elements
This gives more leeway to the notation, allowing font definitions to
become more readable:
\font \f = "combo: 1 / \fontid\one,
2 / \fontid\two / 0x41-0x5a,
3 / \fontid\three / 0x42,
4 / \fontid\three / 0x54 * 69 * U+58"
-rw-r--r-- | src/luaotfload-parsers.lua | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/luaotfload-parsers.lua b/src/luaotfload-parsers.lua index 5ebe8d5..0f87256 100644 --- a/src/luaotfload-parsers.lua +++ b/src/luaotfload-parsers.lua @@ -575,19 +575,22 @@ local modifier_list = Cg(Ct(modifier^0), "modifiers") --- | | --- chars : ------------+--------------+ --- +local comborowsep = ws * comma * ws +local combocolsep = ws * slash * ws +local comborangesep = ws * asterisk * ws local combohex = hex / tonumber local combouint = digit^1 / tonumber local tonumber16 = function (s) return tonumber (s, 16) end local combouni = P"U+" * (digit^1 / tonumber16) local combonum = combohex + combouni + combouint local comborange = Ct(combonum * dash * combonum) + combonum -local combochars = comborange * (asterisk * comborange)^0 -local combodef1 = Ct( Cg(combouint, "idx") --> no chars - * slash * Cg(combouint, "id" )) -local combodef = Ct( Cg(combouint, "idx" ) - * slash * Cg(combouint, "id" ) - * slash * Cg(Ct(combochars^1), "chars")) -local combolist = Ct(combodef1 * (comma * combodef)^1) +local combochars = comborange * (comborangesep * comborange)^0 +local combodef1 = Ct( Cg(combouint, "idx") --> no chars + * combocolsep * Cg(combouint, "id" )) +local combodef = Ct( Cg(combouint, "idx" ) + * combocolsep * Cg(combouint, "id" ) + * combocolsep * Cg(Ct(combochars^1), "chars")) +local combolist = Ct(combodef1 * (comborowsep * combodef)^1) --- lookups ----------------------------------------------------------- local fontname = C((1-S":(/")^1) --- like luatex-fonts local unsupported = Cmt((1-S":(")^1, check_garbage) |