diff options
author | Karl Berry <karl@freefriends.org> | 2016-05-16 18:18:10 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-05-16 18:18:10 +0000 |
commit | 815e54f6a349937be9afb419f12989c0b9652ab3 (patch) | |
tree | 1216f1f111c36e42860b50d3297700956b9cc40f /Master/texmf-dist/tex/context/base/mkiv/util-prs.lua | |
parent | 0f17ceebbcc6309a40823416a4a99e9ddf02dc65 (diff) |
context update + remove nonfree *.icc color profiles
git-svn-id: svn://tug.org/texlive/trunk@41191 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/util-prs.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/util-prs.lua | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-prs.lua b/Master/texmf-dist/tex/context/base/mkiv/util-prs.lua index 01138f1bbb3..02729dd0ef0 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/util-prs.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/util-prs.lua @@ -36,6 +36,8 @@ local lbrace = P("{") local rbrace = P("}") local lparent = P("(") local rparent = P(")") +local lbracket = P("[") +local rbracket = P("]") local period = S(".") local punctuation = S(".,:;") local spacer = lpegpatterns.spacer @@ -44,8 +46,9 @@ local newline = lpegpatterns.newline local anything = lpegpatterns.anything local endofstring = lpegpatterns.endofstring -local nobrace = 1 - (lbrace + rbrace ) -local noparent = 1 - (lparent + rparent) +local nobrace = 1 - (lbrace + rbrace ) +local noparent = 1 - (lparent + rparent) +local nobracket = 1 - (lbracket + rbracket) -- we could use a Cf Cg construct @@ -56,11 +59,12 @@ lpegpatterns.balanced = P { [2] = left * V(1) * right } -local nestedbraces = P { lbrace * (nobrace + V(1))^0 * rbrace } -local nestedparents = P { lparent * (noparent + V(1))^0 * rparent } -local spaces = space^0 -local argument = Cs((lbrace/"") * ((nobrace + nestedbraces)^0) * (rbrace/"")) -local content = (1-endofstring)^0 +local nestedbraces = P { lbrace * (nobrace + V(1))^0 * rbrace } +local nestedparents = P { lparent * (noparent + V(1))^0 * rparent } +local nestedbrackets = P { lbracket * (nobracket + V(1))^0 * rbracket } +local spaces = space^0 +local argument = Cs((lbrace/"") * ((nobrace + nestedbraces)^0) * (rbrace/"")) +local content = (1-endofstring)^0 lpegpatterns.nestedbraces = nestedbraces -- no capture lpegpatterns.nestedparents = nestedparents -- no capture @@ -193,6 +197,16 @@ function parsers.settings_to_array(str,strict) end end +local value = P(lbrace * C((nobrace + nestedbraces)^0) * rbrace) + + C((nestedbraces + nestedbrackets + nestedparents + (1-comma))^0) +local pattern = spaces * Ct(value*(separator*value)^0) + +function parsers.settings_to_array_obey_fences(str) + return lpegmatch(pattern,str) +end + +-- inspect(parsers.settings_to_array_obey_fences("url(http://a,b.c)")) + -- this one also strips end spaces before separators -- -- "{123} , 456 " -> "123" "456" |