Re: Bug in grammar for paths

Bouncing back on this as I'm currently writing a parser.

The grammar on the SVG 1.1 spec includes fractional numbers and numbers 
with an exponent part:

https://www.w3.org/TR/SVG11/paths.html#PathDataBNF

number:
     sign? integer-constant
     | sign? floating-point-constant
integer-constant:
     digit-sequence
floating-point-constant:
     fractional-constant exponent?
     | digit-sequence exponent
fractional-constant:
     digit-sequence? "." digit-sequence
     | digit-sequence "."
exponent:
     ( "e" | "E" ) sign? digit-sequence
sign:
     "+" | "-"
digit-sequence:
     digit
     | digit digit-sequence
digit:
     "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"


While the grammar on the latest SVG 2 CR only contains integers:

https://www.w3.org/TR/2018/CR-SVG2-20181004/paths.html#PathDataBNF

number ::= ([0-9])+


This sounds like an important omission.

Best regards,
Boris

On 29/04/2017 19:26, Jirka Kosek wrote:
> On 29.4.2017 18:57, Paul LeBeau wrote:
>> Paths of the form that I presented do exist and are actually common.  I
>> wasn't around when the grammar was originally written, so I don't know the
>> reason why it was written the way it was.
> Seems that grammar is only illustrational because there are other issues
> with it -- for example grammar accepts only integers not decimal numbers.
>

Received on Sunday, 17 November 2019 16:15:02 UTC