File tree 2 files changed +8
-9
lines changed 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,9 @@ Bug fixes:
82
82
mismatched hashes), Stack will delete the downloaded file and
83
83
recommend either retrying or filing an issue upstream. See
84
84
[ #3319 ] ( https://github.com/commercialhaskell/stack/issues/3319 ) .
85
+ * Modified the flag parser within Stack to match the behavior of
86
+ Cabal's flag parser, which allows multiple sequential dashes. See
87
+ [ #3345 ] ( https://github.com/commercialhaskell/stack/issues/3345 )
85
88
86
89
87
90
## 1.5.1
Original file line number Diff line number Diff line change @@ -24,8 +24,7 @@ module Stack.Types.FlagName
24
24
25
25
import Stack.Prelude
26
26
import Data.Aeson.Extended
27
- import Data.Attoparsec.Combinators
28
- import Data.Attoparsec.Text
27
+ import Data.Attoparsec.Text as A
29
28
import Data.Char (isLetter , isDigit , toLower )
30
29
import qualified Data.Text as T
31
30
import qualified Distribution.PackageDescription as Cabal
@@ -72,13 +71,10 @@ instance FromJSONKey FlagName where
72
71
73
72
-- | Attoparsec parser for a flag name
74
73
flagNameParser :: Parser FlagName
75
- flagNameParser =
76
- fmap (FlagName . T. pack)
77
- (appending (many1 (satisfy isLetter))
78
- (concating (many (alternating
79
- (pured (satisfy isAlphaNum))
80
- (appending (pured (satisfy separator))
81
- (pured (satisfy isAlphaNum)))))))
74
+ flagNameParser = fmap FlagName $ do
75
+ t <- A. takeWhile1 (\ c -> isAlphaNum c || separator c)
76
+ when (T. head t == ' -' ) $ fail " flag name cannot start with dash"
77
+ return t
82
78
where separator c = c == ' -' || c == ' _'
83
79
isAlphaNum c = isLetter c || isDigit c
84
80
You can’t perform that action at this time.
0 commit comments