mirror of
https://github.com/github/semantic.git
synced 2024-12-20 05:11:44 +03:00
Docs, function ordering
This commit is contained in:
parent
92b383cf45
commit
5dfb19cd29
@ -20,16 +20,16 @@ name x = x :| []
|
||||
qualifiedName :: [ByteString] -> Name
|
||||
qualifiedName = NonEmpty.fromList
|
||||
|
||||
-- | Construct a qualified 'Name' from a `/` delimited path.
|
||||
pathToQualifiedName :: ByteString -> Name
|
||||
pathToQualifiedName = qualifiedName . splitOnPathSeparator
|
||||
|
||||
-- | Split a 'ByteString' path on `/`, stripping quotes and any `./` prefix.
|
||||
splitOnPathSeparator :: ByteString -> [ByteString]
|
||||
splitOnPathSeparator = BC.split '/' . BC.dropWhile (== '/') . BC.dropWhile (== '.') . stripQuotes
|
||||
where stripQuotes = B.filter (/= fromIntegral (ord '\"'))
|
||||
|
||||
-- | Construct a qualified 'Name' from a `/` delimited path.
|
||||
pathToQualifiedName :: ByteString -> Name
|
||||
pathToQualifiedName = qualifiedName . splitOnPathSeparator
|
||||
|
||||
-- | User friendly version of a qualified 'Name'.
|
||||
-- | User friendly 'ByteString' of a qualified 'Name'.
|
||||
friendlyName :: Name -> ByteString
|
||||
friendlyName xs = intercalate "." (NonEmpty.toList xs)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user