Fix #1399 - Add a grammar corresponding to the parsing algorithm
This PR add a grammar that corresponds to the algorithm parsing section.
A grammar currently exists in section 4.4.1 but it's much stricter than what user agents actually enforce, and there have been several instances where that grammar was assumed to correspond with the cookie parsing algorithm defined in section 5. By having a separate grammar in section 5, hopefully we can reduce confusion while also preserving the high-level view that a grammar provides.
I'm not sure whether it's worth keeping around the existing grammar in section 4.4.1, but in this initial work I have not attempted to remove it.
CC @sbingler and @miketaylr
I'm not sure whether it's worth keeping around the existing grammar in section 4.4.1, but in this initial work I have not attempted to remove it.
4.4.1 defines the behavior for a well behaved server, while your addition defines what UAs must accept to be compatible with the real world (and misbehaving servers). I think 4.4.1 still serves a useful purpose and I think we should keep it.
I believe I've address all feedback with the most recent commit, but please let me know if I missed anything.