[whatwg/url] Restore formal grammar (#416)

As per #24 I would really like to see a formal grammar in the URL spec.

This is an initial start on such a grammar. I've taken the ABNF from RFC3986.  As far as I can tell, the WHATWG URL spec has removed support for the `ipvfuture` production, so I've ripped that out.  I've also **not** added support for IPv6 zone identifiers from RFC6874, as the WHATWG spec explicitly states

> Support for `<zone_id>` is intentionally omitted.

I'm not sure how to best proceed to add error handling. I think it's probably best to first ensure that the syntax described by the ABNF matches the syntax accepted by the algorithm (without any errors or warnings). Where the algorithm accepts a URL that is not supported by the ABNF, the ABNF could be updated if it the algorithm would not raise a validation error. If there are URLs that will be accepted by the ABNF, the algorithm probably needs to be updated, unless it that syntax is intentionally no longer supported.
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/url/pull/416

-- Commit Summary --

  * Initial restoration of formal grammar

-- File Changes --

    M url.bs (100)

-- Patch Links --

https://github.com/whatwg/url/pull/416.patch
https://github.com/whatwg/url/pull/416.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/pull/416

Received on Sunday, 16 September 2018 10:13:23 UTC