Re: [css3-syntax] Added an "an+b parsing" section, please review

On Sun, Feb 3, 2013 at 3:17 PM, Simon Sapin <simon.sapin@kozea.fr> wrote:
> Le 03/02/2013 15:13, Tab Atkins Jr. a écrit :
>> Sigh, damn comments.
>>
>> I'll have to see if the rest of the WG is okay with ignoring this.
>>
>> It might not be too hard to work around this, though. If I export the
>> list of token pairs that need to have comments inserted when
>> serializing,
>
> Isn’t that what you have here?
> http://dev.w3.org/csswg/css3-syntax/#serialization

Yes.

>> I can invoke that here, and just insert whitespace
>> instead.  That'll still possible be wrong, though - putting a comment
>> between the step and the "n" will fail.
>
> Is it supposed to? AFAICT no-one knows, so there’s probably some room to
> pick whatever is more convenient to spec.

Yeah, it's undefined - the rules are that comments are allowed between
tokens, but the official definition of an+b currently uses a different
tokenizer definition.  Of course, the official definition's tokenizer
is also *wrong* (it violates the longest-match rule), so shrug.  We'll
come up with something.

>> Switching to a pure token-based parsing is the way to fix that for
>> good, but it's so complicated. :/  It's not hard to write down, it's
>> just*long*  and*annoying*.
>
> You’d need to change back the tokenizer to emit comment tokens.
>
> Anyway, I gave this a try back in June (see attachment)
> http://lists.w3.org/Archives/Public/www-style/2012Jun/0159.html
>
> What I got then is probably wrong in many corner cases.

Ooh, I missed this.  If we decide that my string-based reparsing is
inadequate, I'll go over this to provide a start for a token-based
approach.

~TJ

Received on Monday, 4 February 2013 00:06:36 UTC