diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/basicTypes/Lexeme.hs | 26 | ||||
-rw-r--r-- | compiler/ghc.cabal.in | 2 | ||||
-rw-r--r-- | compiler/main/PackageConfig.hs | 2 |
3 files changed, 8 insertions, 22 deletions
diff --git a/compiler/basicTypes/Lexeme.hs b/compiler/basicTypes/Lexeme.hs index a2409614d1..2049e001bf 100644 --- a/compiler/basicTypes/Lexeme.hs +++ b/compiler/basicTypes/Lexeme.hs @@ -6,11 +6,11 @@ module Lexeme ( -- * Lexical characteristics of Haskell names - + -- | Use these functions to figure what kind of name a 'FastString' -- represents; these functions do /not/ check that the identifier -- is valid. - + isLexCon, isLexVar, isLexId, isLexSym, isLexConId, isLexConSym, isLexVarId, isLexVarSym, startsVarSym, startsVarId, startsConSym, startsConId, @@ -33,6 +33,8 @@ import Util ((<||>)) import Data.Char import qualified Data.Set as Set +import GHC.Lexeme + {- ************************************************************************ @@ -86,22 +88,6 @@ isLexVarSym fs -- Infix identifiers e.g. "+" (c:cs) -> startsVarSym c && all isVarSymChar cs -- See Note [Classification of generated names] -------------- -startsVarSym, startsVarId, startsConSym, startsConId :: Char -> Bool -startsVarSym c = startsVarSymASCII c || (ord c > 0x7f && isSymbol c) -- Infix Ids -startsConSym c = c == ':' -- Infix data constructors -startsVarId c = c == '_' || case generalCategory c of -- Ordinary Ids - LowercaseLetter -> True - OtherLetter -> True -- See #1103 - _ -> False -startsConId c = isUpper c || c == '(' -- Ordinary type constructors and data constructors - -startsVarSymASCII :: Char -> Bool -startsVarSymASCII c = c `elem` "!#$%&*+./<=>?@\\^|~-" - -isVarSymChar :: Char -> Bool -isVarSymChar c = c == ':' || startsVarSym c - {- ************************************************************************ @@ -113,7 +99,7 @@ isVarSymChar c = c == ':' || startsVarSym c -} ---------------------- --- External interface +-- External interface ---------------------- -- | Is this an acceptable variable name? @@ -237,7 +223,7 @@ okSymChar c ModifierSymbol -> True OtherSymbol -> True _ -> False - + -- | All reserved identifiers. Taken from section 2.4 of the 2010 Report. reservedIds :: Set.Set String reservedIds = Set.fromList [ "case", "class", "data", "default", "deriving" diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in index 37a4f281d6..f068eb2458 100644 --- a/compiler/ghc.cabal.in +++ b/compiler/ghc.cabal.in @@ -55,7 +55,7 @@ Library template-haskell, hpc, transformers, - bin-package-db, + ghc-boot, hoopl if os(windows) diff --git a/compiler/main/PackageConfig.hs b/compiler/main/PackageConfig.hs index f3cdac77da..9e9775bc04 100644 --- a/compiler/main/PackageConfig.hs +++ b/compiler/main/PackageConfig.hs @@ -37,7 +37,7 @@ import Module import Unique -- ----------------------------------------------------------------------------- --- Our PackageConfig type is the InstalledPackageInfo from bin-package-db, +-- Our PackageConfig type is the InstalledPackageInfo from ghc-boot, -- which is similar to a subset of the InstalledPackageInfo type from Cabal. type PackageConfig = InstalledPackageInfo |