File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -53,13 +53,16 @@ instance Pretty PackageIdentifier where
53
53
-- >>> simpleParsec "foo-bar.4-2" :: Maybe PackageIdentifier
54
54
-- Nothing
55
55
--
56
+ -- >>> simpleParsec "1.2.3" :: Maybe PackageIdentifier
57
+ -- Nothing
58
+ --
56
59
instance Parsec PackageIdentifier where
57
60
parsec = do
58
61
xs' <- P. sepBy1 component (P. char ' -' )
59
62
(v, xs) <- case simpleParsec (last xs') of
60
63
Nothing -> return (nullVersion, xs') -- all components are version
61
64
Just v -> return (v, init xs')
62
- if all (\ c -> all (/= ' .' ) c && not (all isDigit c)) xs
65
+ if not ( null xs) && all (\ c -> all (/= ' .' ) c && not (all isDigit c)) xs
63
66
then return $ PackageIdentifier (mkPackageName (intercalate " -" xs)) v
64
67
else fail " all digits or a dot in a portion of package name"
65
68
where
You can’t perform that action at this time.
0 commit comments