Skip to content

Commit 062f69e

Browse files
committed
Revert "BUG: Parsect PackageIdentifier is broken"
This reverts commit 5b81693.
1 parent 5b81693 commit 062f69e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Cabal-syntax/src/Distribution/Types/PackageId.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ instance Pretty PackageIdentifier where
6464
-- Nothing
6565
instance Parsec PackageIdentifier where
6666
parsec = do
67-
-- comp <- parsec <* P.char '-'
67+
comp <- parsec <* P.char '-'
6868
xs' <- P.sepByNonEmpty component (P.char '-')
6969
(v, xs) <- case simpleParsec (NE.last xs') of
7070
Nothing -> return (nullVersion, toList xs') -- all components are version
7171
Just v -> return (v, NE.init xs')
7272
if not (null xs) && all (\c -> all (/= '.') c && not (all isDigit c)) xs
73-
then return $ PackageIdentifier (mkPackageName (intercalate "-" xs)) v Nothing
73+
then return $ PackageIdentifier (mkPackageName (intercalate "-" xs)) v comp
7474
else fail "all digits or a dot in a portion of package name"
7575
where
7676
component = P.munch1 (\c -> isAlphaNum c || c == '.')

0 commit comments

Comments
 (0)