diff options
author | Karl Berry <karl@freefriends.org> | 2018-03-20 22:10:59 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-03-20 22:10:59 +0000 |
commit | 65d009a0596b194597f47531523addd3e64ed005 (patch) | |
tree | e13bd9beecf63e26491a66aa7a8fa702482f0067 /Master/texmf-dist/tex/context/base/mkiv/util-prs.lua | |
parent | d1a186333ced7b341e26877907343f08211199f7 (diff) |
context [current] (20mar18)
git-svn-id: svn://tug.org/texlive/trunk@47050 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 | 12 |
1 files changed, 7 insertions, 5 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 650a7ead6ae..48d59a9f3f7 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/util-prs.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/util-prs.lua @@ -566,14 +566,16 @@ function parsers.rfc4180splitter(specification) local field = escaped + non_escaped + Cc("") local record = Ct(field * (separator * field)^1) local headerline = record * Cp() - local wholeblob = Ct((newline^(specification.strict and -1 or 1) * record)^0) + local morerecords = (newline^(specification.strict and -1 or 1) * record)^0 + local headeryes = Ct(morerecords) + local headernop = Ct(record * morerecords) return function(data,getheader) if getheader then local header, position = lpegmatch(headerline,data) - local data = lpegmatch(wholeblob,data,position) + local data = lpegmatch(headeryes,data,position) return data, header else - return lpegmatch(wholeblob,data) + return lpegmatch(headernop,data) end end end @@ -604,10 +606,10 @@ local cardinal = lpegpatterns.cardinal / tonumber local spacers = lpegpatterns.spacer^0 local endofstring = lpegpatterns.endofstring -local stepper = spacers * ( C(cardinal) * ( spacers * S(":-") * spacers * ( C(cardinal) + Cc(true) ) + Cc(false) ) +local stepper = spacers * ( cardinal * ( spacers * S(":-") * spacers * ( cardinal + Cc(true) ) + Cc(false) ) * Carg(1) * Carg(2) / ranger * S(", ")^0 )^1 -local stepper = spacers * ( C(cardinal) * ( spacers * S(":-") * spacers * ( C(cardinal) + (P("*") + endofstring) * Cc(true) ) + Cc(false) ) +local stepper = spacers * ( cardinal * ( spacers * S(":-") * spacers * ( cardinal + (P("*") + endofstring) * Cc(true) ) + Cc(false) ) * Carg(1) * Carg(2) / ranger * S(", ")^0 )^1 * endofstring -- we're sort of strict (could do without endofstring) function parsers.stepper(str,n,action) |