Re: [http-state] cookie dates [was Re: Status update]

Ian Hickson wrote:
> On Wed, 12 Aug 2009, Julian Reschke wrote:
>> Ian Hickson wrote:
>>> On Wed, 12 Aug 2009, Daniel Stenberg wrote:
>>>> Combined, it makes it a pain to write a formal syntax spec from.
>>> With HTML5 I've found that rather than defining formal syntaxes for this
>>> kind of thing, it's easier just to define imperative parsing steps that lead
>>> to the right behaviour.
>>>
>>> For example:
>>>
>>>    http://www.whatwg.org/specs/web-apps/current-work/#rules-for-parsing-floating-point-number-values
>> They might be useful for implementers of parsers, but they are almost
>> unreadable for producers.
> 
> They're not intended for producers (in fact they're hidden in the HTML5 
> spec when you select the "author" option) so that's not really that 
> surprising. For producers, you want the much simpler description of what 
> is valid, which often has little bearing on the parsing rules.

(moving this thread over to public-html)

Those descriptions are simpler, but, at least for my taste, still 
unnecessary hard to read; usage of ABNF would make it more readable.

For instance, when I look at "month" I find:

"2.4.5.1 Months

A month consists of a specific proleptic Gregorian date with no 
time-zone information and no date information beyond a year and a month. 
[GREGORIAN]

A string is a valid month string representing a year year and month 
month if it consists of the following components in the given order:

    1. Four or more digits, representing year, where year > 0
    2. A U+002D HYPHEN-MINUS character (-)
    3. Two digits, representing the month month, in the range 1 ≤ month 
≤ 12"

So it defines "month" (in bold) to be a date, consisting of a year and a 
month (non-bold). This is confusing.

Why not simply say:

   year  = 4*DIGIT ; 4 or more digits, year > 0
   month = 2DIGIT  ; 2 digits, 1 <= month <= 12

   month-string = year "-" month

?

BR, Julian





BR, Julian

Received on Wednesday, 12 August 2009 12:19:06 UTC