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:
parent
7b774d764c
commit
ede4039335
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user