Scheme Section 2 quibble

Philip Linde linde.philip at gmail.com
Wed Nov 18 07:33:01 GMT 2020


On Tue, 17 Nov 2020 21:02:09 -0500
Sean Conner <sean at conman.org> wrote:

>   There's nothing in the errata [1] about this, but it seems like it should
> be fixed.

Nothing needs to be fixed. Zero length path segments are allowed in
some circumstances, but they are never allowed in a circumstance where
they could cause ambiguities. For this purpose, there are multiple
definitions of path segments, with -nz (non-empty) and -nz-nc
(non-empty, no colon) suffixes"

   path-abempty  = *( "/" segment )
   path-absolute = "/" [ segment-nz *( "/" segment ) ]
   path-noscheme = segment-nz-nc *( "/" segment )
   path-rootless = segment-nz *( "/" segment )
   path-empty    = 0<pchar>

You can see that relative-ref is designed in such a way as to disallow
any ambiguity, by only allowing path-absolute (which starts with a
single slash and a non-empty segment), path-noscheme (which starts with
a non-empty segment not containing a colon) or path-empty (which is
zero characters):

      relative-ref  = relative-part [ "?" query ] [ "#" fragment ]

      relative-part = "//" authority path-abempty
                    / path-absolute
                    / path-noscheme
                    / path-empty

The "path" definition itself can not be distinguished from a
relative-ref or relative-part, but the path definition is never used by
any other definition in the document. If parsing a relative-ref or
URI-reference, this is never a problem.

--
Philip
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <https://lists.orbitalfox.eu/archives/gemini/attachments/20201118/e4b084e7/attachment.sig>


More information about the Gemini mailing list