Commit 98470570 authored by Duncan Coutts's avatar Duncan Coutts

Improve the parse error message for package name/deps

Make it clear that it's the specification of the package name that
is at fault rather than the package to which the name refers.
parent 5d4d2122
......@@ -676,7 +676,9 @@ parsePackageArgs = parsePkgArgs []
parsePkgArgs ds (arg:args) =
case readPToMaybe parseDependencyOrPackageId arg of
Just dep -> parsePkgArgs (dep:ds) args
Nothing -> Left ("Failed to parse package dependency: " ++ show arg)
Nothing -> Left $
show arg ++ " is not valid syntax for a package name or"
++ " package dependency."
readPToMaybe :: Parse.ReadP a a -> String -> Maybe a
readPToMaybe p str = listToMaybe [ r | (r,s) <- Parse.readP_to_S p str
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment