Skip to content

Commit cbcff08

Browse files
committed
Fix for GHC 9
1 parent efaeed3 commit cbcff08

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/Main.hs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,8 @@ getPackageModulesFromGhcDump = do
792792
("error parsing ghc package dump: " ++ errorBundlePretty e)
793793
>> pure MonoidalMap.empty
794794

795-
Right x ->
795+
Right x -> do
796+
print x
796797
pure x
797798

798799
parsePackageDump :: Parser (MonoidalMap ModuleName (NESet PackageSource))
@@ -813,7 +814,7 @@ parsePackageDumpPackage = do
813814
skipSomeTill
814815
(try skipLine)
815816
( asum
816-
[ (,True) <$> try parseExposedModules
817+
[ (,True) <$> parseExposedModules
817818
, ([], False) <$ try packageEnd
818819
]
819820
)
@@ -838,15 +839,18 @@ parsePackageDumpPackage = do
838839
string "exposed-modules:"
839840
>> (void eol <|> pure ())
840841
>> some
841-
( try
842-
$ skipSome nonEolSpaceChar
843-
>> sepBy1 parseModuleName nonEolSpaceChar
842+
( skipSome nonEolSpaceChar
843+
>> sepBy1 (parseModuleName <* optional from <* optional ",") nonEolSpaceChar
844844
<* eol
845845
)
846846
<&> concat
847847

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

850+
from = do
851+
_ <- " from "
852+
some $ choice [ alphaNumChar, char '-', char ':', char '.' ]
853+
850854
nonEolSpaceChar :: Parser ()
851855
nonEolSpaceChar =
852856
void $ notFollowedBy eol >> (spaceChar <|> char '\t')

0 commit comments

Comments
 (0)