Skip to content

Commit

Permalink
Fix for GHC 9
Browse files Browse the repository at this point in the history
  • Loading branch information
ocharles committed Mar 20, 2022
1 parent efaeed3 commit ddac243
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ parsePackageDumpPackage = do
skipSomeTill
(try skipLine)
( asum
[ (,True) <$> try parseExposedModules
[ (,True) <$> parseExposedModules
, ([], False) <$ try packageEnd
]
)
Expand All @@ -838,15 +838,18 @@ parsePackageDumpPackage = do
string "exposed-modules:"
>> (void eol <|> pure ())
>> some
( try
$ skipSome nonEolSpaceChar
>> sepBy1 parseModuleName nonEolSpaceChar
( skipSome nonEolSpaceChar
>> sepBy1 (parseModuleName <* optional from <* optional ",") nonEolSpaceChar
<* eol
)
<&> concat

packageEnd = try (string "---" >> (void eol <|> eof)) <|> eof

from = do
_ <- " from "
some $ choice [ alphaNumChar, char '-', char ':', char '.' ]

nonEolSpaceChar :: Parser ()
nonEolSpaceChar =
void $ notFollowedBy eol >> (spaceChar <|> char '\t')

0 comments on commit ddac243

Please sign in to comment.