[csswg-drafts] [css-syntax] Possible error in 4.3.4: Consume an ident-like token. (#3600)

tabatkins has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-syntax] Possible error in 4.3.4: Consume an ident-like token. ==
(migrated from the mailing list)

**Ezequiel Rodriguez said:**

> 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.

-------------

**Tab Atkins said:**

> 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.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3600 using your GitHub account

Received on Saturday, 2 February 2019 00:39:09 UTC