Skip to content
Snippets Groups Projects
Commit 06c9595c authored by Patrick Augusto's avatar Patrick Augusto
Browse files

Adding boundaries for the other-extensions parser

parent 6fff94d8
No related branches found
No related tags found
No related merge requests found
......@@ -134,13 +134,17 @@ retrieveModuleExtensions m = do
catMaybes <$> map (simpleParsec . trim) . grabModuleExtensions <$> readFile m
where
stop c = (c /= '\n') && (c /= ' ') && (c /= ',')
stop c = (c /= '\n') && (c /= ' ') && (c /= ',') && (c /= '#')
grabModuleExtensions [] = []
grabModuleExtensions ('-':'-':xs) = grabModuleExtensions $ dropWhile' (/= '\n') xs
grabModuleExtensions ('L':'A':'N':'G':'U':'A':'G':'E':' ':xs) = takeWhile' stop xs : grabModuleExtensions (dropWhile' stop xs)
grabModuleExtensions (',':xs) = takeWhile' stop xs : grabModuleExtensions (dropWhile' stop xs)
grabModuleExtensions ('L':'A':'N':'G':'U':'A':'G':'E':xs) = takeWhile' stop xs : grabModuleExtensions' (dropWhile' stop xs)
grabModuleExtensions (_:xs) = grabModuleExtensions xs
grabModuleExtensions' [] = []
grabModuleExtensions' ('#':xs) = grabModuleExtensions xs
grabModuleExtensions' (',':xs) = takeWhile' stop xs : grabModuleExtensions' (dropWhile' stop xs)
grabModuleExtensions' (_:xs) = grabModuleExtensions xs
takeWhile' :: (Char -> Bool) -> String -> String
takeWhile' p = takeWhile p . trim
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment