local lpeg = require "lpeg"
lpeg.locale(lpeg)
local space = lpeg.space ^ 0
- local name = lpeg.C(lpeg.alpha ^ 1) * space
- local sep = space * (lpeg.S("\\;") * space) + (lpeg.P(lpeg.graph - lpeg.P(',')) * lpeg.space ^ 1)
- local value = lpeg.C(lpeg.P(lpeg.P(lpeg.graph + lpeg.space) - sep) ^ 1)
+ local name = lpeg.C(lpeg.alpha ^ 1)
+ local sep = space * lpeg.S("\\;") * space
+ local value = lpeg.C(lpeg.P(lpeg.P((lpeg.space ^ 1) * lpeg.graph + lpeg.P(lpeg.graph)) - sep) ^ 1)
local pair = lpeg.Cg(name * "=" * space * value) * sep ^ -1
local list = lpeg.Cf(lpeg.Ct("") * pair ^ 0, rawset)
local version = lpeg.P("v") * space * lpeg.P("=") * space * lpeg.P("DMARC1")