diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2021-01-12 16:04:51 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-01-17 05:57:35 -0500 |
commit | e516ef7eb73ae19cc07c4f1da5270783b54a17f1 (patch) | |
tree | a59073e565c46a96cca206eaec6ecb7659622165 | |
parent | d2b10eac6eab85ef50071261c55da94a20fc6d0f (diff) | |
download | haskell-e516ef7eb73ae19cc07c4f1da5270783b54a17f1.tar.gz |
Hadrian: fix flavour parser
Hadrian was silently using the "quick" flavour when "quick-debug" or
"quick-validate" was used. This patch fixes the parser and ensures that
the whole input is consumed.
-rw-r--r-- | hadrian/src/Flavour.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/hadrian/src/Flavour.hs b/hadrian/src/Flavour.hs index a7a32ed634..ec9bfa2c5b 100644 --- a/hadrian/src/Flavour.hs +++ b/hadrian/src/Flavour.hs @@ -117,13 +117,14 @@ parseFlavour baseFlavours transformers str = parser = do base <- baseFlavour transs <- P.many flavourTrans + P.eof return $ foldr ($) base transs baseFlavour :: Parser Flavour baseFlavour = P.choice [ f <$ P.try (P.string (name f)) - | f <- baseFlavours - ] + | f <- reverse (sortOn name baseFlavours) + ] -- needed to parse e.g. "quick-debug" before "quick" flavourTrans :: Parser (Flavour -> Flavour) flavourTrans = do |