Skip to content

Commit 482a1fc

Browse files
committed
feat: add parser for UserQualExe
1 parent 578f778 commit 482a1fc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cabal-install/src/Distribution/Client/Targets.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -721,10 +721,10 @@ instance Parsec UserConstraint where
721721
| otherwise = P.unexpected $ "constraint scope: " ++ unPackageName pn
722722

723723
withColon :: PackageName -> m UserConstraintQualifier
724-
withColon pn =
725-
UserQualified (UserQualSetup pn)
726-
<$ P.string "setup."
727-
<*> parsec
724+
withColon pn = P.choice
725+
[ UserQualified (UserQualSetup pn) <$> (P.string "setup." *> parsec)
726+
, UserQualified . UserQualExe pn <$> (P.string "exe:" *> parsec) <*> (P.char '.' *> parsec)
727+
]
728728

729729
-- >>> eitherParsec "foo > 1.2.3.4" :: Either String UserConstraint
730730
-- Right (UserConstraintX (UserConstraintScope Nothing (UserQualified UserQualToplevel (PackageName "foo"))) (PackagePropertyVersion (LaterVersion (mkVersion [1,2,3,4]))))

0 commit comments

Comments
 (0)