Commit 0832e51f authored by Jamie A. Jennings's avatar Jamie A. Jennings

RENAMED net.url to be net.url_strict. REDEFINED net.url to match what used to...

RENAMED net.url to be net.url_strict.  REDEFINED net.url to match what used to be called net.url_common (and keeping net.url_common for compatibility).
parent a7e36285
Pipeline #51048936 failed with stage
in 1 minute and 29 seconds
......@@ -238,19 +238,35 @@ uri = { scheme ":" authpath? { "?" query }? { "#" fragment }? }
---------------------------------------------------------------------------------------------------
-- "The term 'URL' does not refer to a formal partition of URI space; rather, URL is a useful but
-- informal concept" (http://www.w3.org/TR/uri-clarification). We will take advantage of the
-- informality to use the name 'url' to refer to a uri that requires an authpath. A uri will match
-- "foo:" but a url will not.
-- We also modify the url pattern to avoid accepting input of the form "xyz::w".
url = { scheme ":" !":" authpath { "?" query }? { "#" fragment }? }
url_common = { scheme ":" >"//" authpath { "?" query }? { "#" fragment }? }
-- test url rejects "foo:"
-- test url rejects "xyz::w"
-- test url accepts "bold:net.*=red:net.ipv6=red;"
-- test url_common rejects "bold:net.*=red:net.ipv6=red;"
-- informal concept" (http://www.w3.org/TR/uri-clarification).
--
-- We will take advantage of the informality to use the name 'url' to refer to a uri that requires
-- an authpath. A uri will match "foo:" but a url will not.
--
-- Another point of difference between URI and URL is that we define our url pattern to reject input
-- of the form "xyz::w".
--
-- Finally, we define url_strict to follow the rules we have stated thus far. We call it
-- url_strict because, using its strict definition, it will match many strings that do not look like
-- typical URLs. The pattern url will match URLs as they are commonly found.
url_strict = { scheme ":" !":" authpath { "?" query }? { "#" fragment }? }
url = { scheme ":" >"//" authpath { "?" query }? { "#" fragment }? }
-- %% Change from v1.0.0: The Rosie v1.0.0 net.url has been renamed to net.url_strict in order to
-- %% follow the naming convention established already by fqdn_strict and ipv6_strict.
url_common = url -- Backwards compatibility with v1.0.0
-- test url_strict accepts "https://rosie-lang.org", "ftp://example.net/Rosie/The/Riveter#WorldWar2"
-- test url_strict accepts "a:b", "a:b?c", "a:b?c#d"
-- test url_strict accepts "bold:net.*=red:net.ipv6=red;"
-- test url_strict rejects "foo:", "xyz::w"
-- test url accepts "https://rosie-lang.org", "ftp://example.net/Rosie/The/Riveter#WorldWar2"
-- test url rejects "a:b", "a:b?c", "a:b?c#d"
-- test url rejects "bold:net.*=red:net.ipv6=red;"
-- test url rejects "foo:", "xyz::w"
---------------------------------------------------------------------------------------------------
-- HTTP commands
......@@ -278,4 +294,4 @@ MAC = MAC_cisco / MAC_windows / MAC_common
---------------------------------------------------------------------------------------------------
-- Match an IP, Host, Email, URL
any = ip / MAC / fqdn_practical / email / url_common / path
any = ip / MAC / fqdn_practical / email / url / path
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment