From a5aaceecaa04ce7ea5bade6eb96c0d129109c15a Mon Sep 17 00:00:00 2001 From: Sylvain Henry Date: Wed, 19 Aug 2020 20:16:21 +0200 Subject: Use ADTs for parser errors/warnings Haskell and Cmm parsers/lexers now report errors and warnings using ADTs defined in GHC.Parser.Errors. They can be printed using functions in GHC.Parser.Errors.Ppr. Some of the errors provide hints with a separate ADT (e.g. to suggest to turn on some extension). For now, however, hints are not consistent across all messages. For example some errors contain the hints in the main message. I didn't want to change any message with this patch. I expect these changes to be discussed and implemented later. Surprisingly, this patch enhances performance. On CI (x86_64/deb9/hadrian, ghc/alloc): parsing001 -11.5% T13719 -2.7% MultiLayerModules -3.5% Naperian -3.1% Bump haddock submodule Metric Decrease: MultiLayerModules Naperian T13719 parsing001 --- testsuite/tests/parser/should_run/CountParserDeps.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testsuite/tests/parser/should_run') diff --git a/testsuite/tests/parser/should_run/CountParserDeps.hs b/testsuite/tests/parser/should_run/CountParserDeps.hs index ae344aaf49..5c7cb0eef3 100644 --- a/testsuite/tests/parser/should_run/CountParserDeps.hs +++ b/testsuite/tests/parser/should_run/CountParserDeps.hs @@ -28,7 +28,7 @@ main = do [libdir] <- getArgs modules <- parserDeps libdir let num = sizeUniqSet modules - max_num = 201 + max_num = 203 min_num = max_num - 10 -- so that we don't forget to change the number -- when the number of dependencies decreases -- putStrLn $ "Found " ++ show num ++ " parser module dependencies" -- cgit v1.2.1