Name: make "." parse as a relative ".", rather than a bogus empty absolute name

This commit is contained in:
Mitchell Rosen 2021-10-13 11:58:14 -04:00
parent 4d72bcc206
commit 5caef015b2

View File

@ -361,7 +361,7 @@ unsafeFromString =
unsafeFromText :: Text -> Name
unsafeFromText = \case
"." -> error "empty absolute name"
"." -> Name Relative ("." :| [])
".." -> Name Absolute ("." :| [])
t | Text.any (== '#') t -> error ("not a name: " <> show t)
t ->