W3C home > Mailing lists > Public > www-style@w3.org > July 2013

Re: [css-syntax] string to number feedback

From: Simon Sapin <simon.sapin@exyr.org>
Date: Mon, 01 Jul 2013 08:34:51 +0100
Message-ID: <51D1311B.80405@exyr.org>
To: marc@marcomorain.com
CC: www-style@w3.org
Le 30/06/2013 21:56, Marc O'Morain a écrit :
> Hi there,
>
> I have been implementing a parser for the CSS spec at
> http://dev.w3.org/csswg/css-syntax/ and I have noticed 2 problems. I'm
> not sure if this is the correct place to report issues – if not, please
> let me know where I should send my comments.

Hi Marc,

This is the right place, thanks for the bug report.


>  > 4.3.12 Consume a number
>  >
>  > 5. If the next 2 input characters are U+0045 LATIN CAPITAL LETTER E
> (E) or U+0065 LATIN SMALL LETTER E (e) followed by a digit, then:
>
>
> This section omits the possibility of having a + or - minus before the
> exponent when tokenising....

Fixed.


>  > 4.3.13 Convert a string to a number
>  >
>  > 7.  An exponent: zero or more digits. If there is at least one digit,
> let i be the number formed by interpreting the digits as a base-10
> integer; otherwise, let i be the number 0.
>  > Return the number s·(i + f·10-d)·10te.
>
> In point 7 above I think it should read "let e be the number" in both
> cases, rather than 'i'.

Fixed.


> I have a unit test test that exposes the issue here:
> https://github.com/marcomorain/crush/blob/1848fef/test/main.c#L84

I’ve been writing tests for css-syntax in JSON format in order to use 
them in multiple implementations. Hopefully they can also be useful to you:

https://github.com/SimonSapin/tinycss2/tree/master/tinycss2/tests

Let me know if you use them, I might split them into their own 
repository later.

Cheers,
-- 
Simon Sapin
Received on Monday, 1 July 2013 07:35:07 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:31 UTC