1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 16:33:03 +03:00

centralize a single 'stripQuotes' function

This commit is contained in:
Patrick Thomson 2018-06-04 11:41:17 -04:00
parent 7b774d764c
commit ede4039335
2 changed files with 0 additions and 2 deletions

View File

@ -21,7 +21,6 @@ data ImportPath = ImportPath { unPath :: FilePath, pathIsRelative :: Relative }
importPath :: Text -> ImportPath
importPath str = let path = stripQuotes str in ImportPath (T.unpack path) (pathType path)
where
stripQuotes = T.dropAround (`elem` ("\'\"" :: String))
pathType xs | not (T.null xs), T.head xs == '.' = Relative -- TODO: head is partial
| otherwise = NonRelative

View File

@ -27,7 +27,6 @@ data ImportPath = ImportPath { unPath :: FilePath, pathIsRelative :: Relative }
importPath :: Text -> ImportPath
importPath str = let path = stripQuotes str in ImportPath (T.unpack path) (pathType path)
where
stripQuotes = T.dropAround (`elem` ("\'\"" :: String))
pathType xs | not (T.null xs), T.head xs == '.' = Relative -- TODO: fix partiality
| otherwise = NonRelative