W3C home > Mailing lists > Public > www-style@w3.org > February 2003

Re: Core syntax error handling

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 27 Feb 2003 05:47:27 -0800 (PST)
To: Etan Wexler <ewexler@stickdog.com>
Cc: "www-style@w3.org" <www-style@w3.org>
Message-ID: <Pine.LNX.4.50.0302270541280.14072-100000@dhalsim.dreamhost.com>

On Thu, 27 Feb 2003, Etan Wexler wrote:
>> At a basic level it is very simple: you hit an unexpected character, and
>> therefore parse the declaration as an unknown stream of tokens, honouring
>> the nesting of {}, [], and (), and the special rules for '' and ""
>> strings, and /* */ comments, until you reach the end of the declaration
>> or the end of the block.
> What declaration?

In my book, a declaration is a stream of tokens found in a a block, ending
with a semicolon or the end of the block.

> What block?

A stream of tokens delimited by { and }.

> These constructs have clear syntactic definitions and the case you
> describe does not match those definitions. Any parsing past the
> unexpected character is really just guessing on the part of the parser.

But it doesn't have to be. David Baron is doing some great work in the
Syntax module defining the core syntax and the CSS3 syntax in such a way
that any character stream is parseable.

> If you write a new syntax, we will at least have some basis from
> which to consider dropping the old core syntax, despite the
> latter's promise of indefinite longevity and stability.

The new syntax would simply be increasing the range of files that can be
considered valid CSS, so I do not see a problem here. No UA throws out
entire stylesheets just because they don't match the core grammar; instead
they all do the same as they did with HTML: They follow proprietary rules
to recover from errors. I do _not_ want to see a repeat of the HTML Tag
Soup nightmare repeated with CSS, and I don't want to go down the route of
XML (parse or die).

Ian Hickson                                      )\._.,--....,'``.    fL
"meow"                                          /,   _.. \   _\  ;`._ ,.
http://index.hixie.ch/                         `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 27 February 2003 08:47:24 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:06 UTC