Re: [whatwg/url] Provide a succinct grammar for valid URL strings (#479)

This might be a more complicated problem than you think. I have tried several times, but the scheme dependent behaviour causes a lot of duplicate rules, so you end up with a grammar that is not very concise nor easy to read. And there is a tricky problem with repeated slashes before the host, the handling of which is base URL dependent. 

I have some notes on it [here][1]. (I eventually went with a hybrid approach of a couple of very simple grammars and some logic rules in between). This ties into a model of URLs that I describe [here][2]. 

What's the status of this? It really does work. I developed the theory when I tried to write a library that supports relative URLs. I am quite confident that it matches the standard (but not everything is described in the notes); as the library now passes all of the parsing tests. 

[1]: https://github.com/alwinb/reurl/blob/master/doc/grammar.md
[2]: https://github.com/alwinb/reurl/blob/master/doc/theory.md


-- 
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/issues/479#issuecomment-708482325

Received on Wednesday, 14 October 2020 15:33:54 UTC