Re: [css-syntax] Possible error in 4.3.4: Consume an ident-like token.

On Fri, Jul 25, 2014 at 4:35 AM, Ezequiel Rodriguez <ezequiel@yahoo.com> wrote:
> Context: http://dev.w3.org/csswg/css-syntax/#consume-an-ident-like-token
>
> In the third paragraph, it states:
>
>     ... If the next input token is U+0022 QUOTATION MARK (") or U+0027
> APOSTROPHE ('),
>     reconsume the current input code point, then create a <function-token>
> with its value set to the returned string and return it.
>
> At the point in time the above statement is executed, the current input code
> point is U+0028 LEFT PARENTHESIS ((). If we reconsume the current input code
> point, as instructed, the next token in the stream would then be a
> <delim-token> with the value of U+0028 LEFT PARENTHESIS (().
>
> Is this the desired behavior? It doesn't seem so, as we always consume the
> U+0028 LEFT PARENTHESIS (() code point if it is seen-- as described in two
> other places of "Consume an ident-like token."
>
> In conclusion, I believe the "reconsume the current input code point"
> portion can safely be removed.

There is a mistake there, but not the one you noticed. ^_^

The reconsume line there is intentional - if there's any whitespace
between the ( and ", I want to eventually emit a whitespace token.
Since the algo consumes all of that, though, I have to reconsume so
that the next call to consumeAToken correctly sees a whitespace
codepoint.

The bug is that if there's no whitespace, then I end up reconsuming
the ( code point, which I don't want to do.

Good catch, and fixed.

~TJ

Received on Friday, 25 July 2014 18:03:29 UTC