summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-01-12 16:04:51 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-01-17 05:57:35 -0500
commite516ef7eb73ae19cc07c4f1da5270783b54a17f1 (patch)
treea59073e565c46a96cca206eaec6ecb7659622165 /hadrian
parentd2b10eac6eab85ef50071261c55da94a20fc6d0f (diff)
downloadhaskell-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.
Diffstat (limited to 'hadrian')
-rw-r--r--hadrian/src/Flavour.hs5
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