Re: [css-syntax] Comments on "Parser Algorithms" section

On Tue, Jun 25, 2013 at 4:12 PM, L. David Baron <dbaron@dbaron.org> wrote:
> Following are comments on section "5.4 Parser Algorithms" of
> http://dev.w3.org/csswg/css-syntax/#parser-algorithms as of hg
> revision 20a5abc61ca3.
>
>
> I'm a little concerned about the "component value" terminology; I'd
> prefer using a term that doesn't involve "value".  But I don't have
> a better idea right now.
>
>
> I think it would be clearer if, in "Consume a simple block", the
> sentence:
>   # Create a simple block with its associated token set to the current
>   # input token.
> said:
>   # Create a simple block with its associated token set to the current
>   # input token and its value set to the empty list.
> to make it clear that there are two pieces in the data model of a
> simple block.  (And, in general, it might be better to more clearly
> define the data model of these objects by describing all the parts
> of them when they're created, or perhaps even more explicitly.)
>
>
> "Consume a qualified rule" is a bit unclear as to the type of the
> value; I think think the opening sentence should probably replace
> "nothing" with "empty list", since the value is a list.
>
>
> I also find the spec lacks a bit of precision as to what consuming a
> token actually means in terms of the current input token and the
> next input token.  Many parts of the parsing spec say "consume the
> next input token", which presumably makes it the current input token
> unless there's been a previous "reconsume the current input token".
> I think the spec should be more explicit about this, and also about
> the fact that it would be an error for the spec to say "reconsume
> the current input token" when it's already done so since the last
> "consume the next input token".
>
> I think there are also some cases where the wording gets things
> wrong in terms of this model.  For example, I think the first
> sentence of "Consume a declaration" which is currently:
>   # Create a new declaration with its name set to the value of the
>   # current input token.
> should have an additional "and consume the next input token" at the
> end.  Then the following sentence which currently says:
>   # Repeatedly consume 〈whitespace〉s until a non-〈whitespace〉 is
>   # reached.
> should instead say something like:
>   # Until the current input token is non-<whitespace>, repeatedly
>   # consume the next input token.
> Without such a change, it makes the "Consume a declaration" prose
> seem like it errors out every time since the initial identifier is
> not a <colon>.
>
>
> After doing this review, I'm comfortable with a first public working
> draft of css-syntax.

Yay, thank you, David!  I'll get your changes done tomorrow.

~TJ

Received on Tuesday, 25 June 2013 23:48:51 UTC