New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grammar matches against non-URI strings #4
Comments
|
RFC 3986, Uniform Resource Identifier (URI): Generic Syntax, has a section (4.2) on the "Relative Reference" which makes the empty string a valid relative reference, or URI of sorts, relative to a base URI. So relative to http://github.com both the empty string and '/foo.html' are valid relative references. I have chosen to make a relative reference a valid thing to parse as an URI. In response to this situation w3 (see http://www.w3.org/TR/2011/WD-html5-20110113/author/urls.html) has identified the concept of "a valid non-empty URL". As discussed on IRC yesterday, http://irclog.perlgeek.de/perl6/2012-05-31#i_5662923, the URI module has a validating URI rule which somewhat addresses the initial complaint of treating " " as an URI. If you don't need relative references there is also a URI rule which should match http://gitub.com and ftp://rakudo.org. You raised an objection that sometimes you are searching for URIs and matching the empty string doesn't really make sense. In response I propose to add a "valid non-empty URL(/URI)" rule which can be used for such searches. Thoughts?? |
|
Since there was no other comment on this matter I added a grammar rule TOP_non_empty to partially remedy bbkr's complaint. It seems to me that it is reasonable to add a search method to the URI module, which would also make it easy to add some tests. Note that this functionality goes beyond Perl 5 URI AFAIK. The additional step is a bit involved since I think it would also make sense for the search method to be lazy and fixing that may wait for another day. So some progress on this issue but leaving it open for now. |
|
Resolution of this now depends on an open rakudo ticket https://rt.perl.org/rt3/Ticket/Display.html?id=112716 |
IRC log
The text was updated successfully, but these errors were encountered: