projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ba05282
)
Layout and white space only
author
simonpj@microsoft.com
<unknown>
Wed, 22 Dec 2010 17:49:50 +0000
(17:49 +0000)
committer
simonpj@microsoft.com
<unknown>
Wed, 22 Dec 2010 17:49:50 +0000
(17:49 +0000)
compiler/basicTypes/RdrName.lhs
patch
|
blob
|
history
diff --git
a/compiler/basicTypes/RdrName.lhs
b/compiler/basicTypes/RdrName.lhs
index
c5b777b
..
c8a510f
100644
(file)
--- a/
compiler/basicTypes/RdrName.lhs
+++ b/
compiler/basicTypes/RdrName.lhs
@@
-384,18
+384,6
@@
plusParent :: Parent -> Parent -> Parent
plusParent p1 p2 = ASSERT2( p1 == p2, parens (ppr p1) <+> parens (ppr p2) )
p1
plusParent p1 p2 = ASSERT2( p1 == p2, parens (ppr p1) <+> parens (ppr p2) )
p1
-{- Why so complicated? -=chak
-plusParent :: Parent -> Parent -> Parent
-plusParent NoParent rel =
- ASSERT2( case rel of { NoParent -> True; other -> False },
- ptext (sLit "plusParent[NoParent]: ") <+> ppr rel )
- NoParent
-plusParent (ParentIs n) rel =
- ASSERT2( case rel of { ParentIs m -> n==m; other -> False },
- ptext (sLit "plusParent[ParentIs]:") <+> ppr n <> comma <+> ppr rel )
- ParentIs n
- -}
-
emptyGlobalRdrEnv :: GlobalRdrEnv
emptyGlobalRdrEnv = emptyOccEnv
emptyGlobalRdrEnv :: GlobalRdrEnv
emptyGlobalRdrEnv = emptyOccEnv
@@
-439,10
+427,13
@@
lookupGRE_Name env name
gre_name gre == name ]
getGRE_NameQualifier_maybes :: GlobalRdrEnv -> Name -> [Maybe [ModuleName]]
gre_name gre == name ]
getGRE_NameQualifier_maybes :: GlobalRdrEnv -> Name -> [Maybe [ModuleName]]
+-- Returns all the qualifiers by which 'x' is in scope
+-- Nothing means "the unqualified version is in scope"
getGRE_NameQualifier_maybes env
= map qualifier_maybe . map gre_prov . lookupGRE_Name env
getGRE_NameQualifier_maybes env
= map qualifier_maybe . map gre_prov . lookupGRE_Name env
- where qualifier_maybe LocalDef = Nothing
- qualifier_maybe (Imported iss) = Just $ map (is_as . is_decl) iss
+ where
+ qualifier_maybe LocalDef = Nothing
+ qualifier_maybe (Imported iss) = Just $ map (is_as . is_decl) iss
pickGREs :: RdrName -> [GlobalRdrElt] -> [GlobalRdrElt]
-- ^ Take a list of GREs which have the right OccName
pickGREs :: RdrName -> [GlobalRdrElt] -> [GlobalRdrElt]
-- ^ Take a list of GREs which have the right OccName