diff options
| author | Thomas Miedema <thomasmiedema@gmail.com> | 2015-07-03 01:19:59 +0200 |
|---|---|---|
| committer | Thomas Miedema <thomasmiedema@gmail.com> | 2015-07-04 10:36:54 +0200 |
| commit | 69beef56a4c020d08e1b0243d4c1a629f972e019 (patch) | |
| tree | 73b92a2a3f0821c7dd26ba4678d964de4aaf95ce /compiler/parser | |
| parent | 889c81c657b5719a8f4091099b7bf186127e9f53 (diff) | |
| download | haskell-69beef56a4c020d08e1b0243d4c1a629f972e019.tar.gz | |
Replace usages of `-w` by `-fno-warn`s
And remove unused imports and language pragmas.
I checked that the minimum Happy and Alex version requirements, as
listed in aclocal.m4, don't have to change. Before building ghc, I ran:
- cabal install happy==1.19.4 --with-ghc=ghc-7.8.4
- cabal install alex==3.1.0 --with-ghc=ghc-7.6.3
Differential Revision: https://phabricator.haskell.org/D1032
Diffstat (limited to 'compiler/parser')
| -rw-r--r-- | compiler/parser/Lexer.x | 23 | ||||
| -rw-r--r-- | compiler/parser/Parser.y | 8 |
2 files changed, 11 insertions, 20 deletions
diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 2e883fd102..1ee5c0315f 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -43,15 +43,17 @@ { -- XXX The above flags turn off warnings in the generated code: {-# LANGUAGE BangPatterns #-} -{-# LANGUAGE DeriveDataTypeable #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} -{-# OPTIONS_GHC -fno-warn-unused-imports #-} +{-# OPTIONS_GHC -fno-warn-tabs #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} --- But alex still generates some code that causes the "lazy unlifted bindings" --- warning, and old compilers don't know about it so we can't easily turn --- it off, so for now we use the sledge hammer: -{-# OPTIONS_GHC -w #-} +{-# OPTIONS_GHC -fno-warn-overlapping-patterns #-} +{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-} +-- The above warning suppression flags are a temporary kludge. +-- While working on this module you are encouraged to remove it and fix +-- any warnings in the module. See +-- http://ghc.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings +-- for details {-# OPTIONS_GHC -funbox-strict-fields #-} @@ -77,13 +79,14 @@ module Lexer ( ) where -- base +#if __GLASGOW_HASKELL__ < 709 import Control.Applicative +#endif import Control.Monad import Data.Bits -import Data.Char +import Data.Char hiding (ord) import Data.List import Data.Maybe -import Data.Ratio import Data.Word -- bytestring @@ -93,10 +96,6 @@ import Data.ByteString (ByteString) import Data.Map (Map) import qualified Data.Map as Map --- data/typeable -import Data.Data -import Data.Typeable - -- compiler/utils import Bag import Outputable diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index b20b50c91b..a2d89b2498 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -8,14 +8,6 @@ -- --------------------------------------------------------------------------- { -{-# LANGUAGE BangPatterns #-} -- required for versions of Happy before 1.18.6 -{-# OPTIONS -Wwarn -w #-} --- The above warning suppression flag is a temporary kludge. --- While working on this module you are encouraged to remove it and fix --- any warnings in the module. See --- http://ghc.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings --- for details - -- | This module provides the generated Happy parser for Haskell. It exports -- a number of parsers which may be used in any library that uses the GHC API. -- A common usage pattern is to initialize the parser state with a given string |
