Re: [svgwg] SVG2 path data coordinates are currently spec'd as integers.

Okay, unless I've screwed something else up, the grammar should be:
```
elliptical_arc_argument::=
    unsigned_float comma_wsp? unsigned_float comma_wsp? float comma_wsp
    flag comma_wsp? flag comma_wsp? coordinate_pair

elliptical_arc_closing_argument::=
    unsigned-float comma_wsp? unsigned-float comma_wsp? float comma_wsp
    flag comma_wsp? flag comma_wsp? closepath

bearing_argument_sequence::=
    bearing_argument | (bearing_argument comma_wsp? bearing_argument_sequence)

bearing_argument ::= float

sign           ::= "+" | "-"
digits         ::= [0-9]+
exponent       ::= ( "E" | "e" ) sign? digits
fraction       ::= ( digits ( "." digits? )? ) | ( "." digits )
unsigned_float ::= fraction exponent?
float          ::= sign unsigned-float
coordinate     ::= signed-float
```
I've reverted to `"E" | "e"` in the `exponent` for consistency with the rest of the spec.

I've created `bearing_argument` for semantic reasons. (Separate issue: aren't multiple bearing arguments redundant? Whether it;s relative or absolute, the bearing will always take on the value of the last bearing_argument.)

You can rename `float` and `unsigned_float` as `number` and `nonnegative_number` if you like. I'm not going be precious about any of this; I just can't believe nobody has fixed this in all this time.

If SVG numbers are brought into line with CSS numbers, then fraction changes to:
```
fraction       ::= ( digits ( "." digits )? ) | ( "." digits )
```
i.e. drop the first `?`.

I'm not really a grammar geek _\*deletes rant about the grammar using right-recursion over the Kleene star\*_ so it's possible this will produce a horrible parse tree or has transgressed LALR(1) in some way. But it's better than what's there.

-- 
GitHub Notification of comment by fuchsia
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/335#issuecomment-317863400 using your GitHub account

Received on Tuesday, 25 July 2017 20:32:55 UTC