X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Frename%2FRnExpr.lhs;h=08b176386e8af258bf9c7be426351dc8f260ad48;hb=f7ecf7234c224489be8a5e63fced903b655d92ee;hp=cfb377d52806436ae5c41b9911f6b35d5c2e43a2;hpb=4250d64191132fd493985549eda5ca05b82a663f;p=ghc-hetmet.git diff --git a/ghc/compiler/rename/RnExpr.lhs b/ghc/compiler/rename/RnExpr.lhs index cfb377d..08b1763 100644 --- a/ghc/compiler/rename/RnExpr.lhs +++ b/ghc/compiler/rename/RnExpr.lhs @@ -5,7 +5,7 @@ Basically dependency analysis. -Handles @Match@, @GRHSsAndBinds@, @HsExpr@, and @Qual@ datatypes. In +Handles @Match@, @GRHSsAndBinds@, @HsExpr@, and @Qualifier@ datatypes. In general, all of these functions return a renamed thing, and a set of free variables. @@ -17,8 +17,8 @@ module RnExpr ( checkPrecMatch ) where -import Ubiq -import RnLoop -- break the RnPass/RnExpr/RnBinds loops +IMP_Ubiq() +IMPORT_DELOOPER(RnLoop) -- break the RnPass/RnExpr/RnBinds loops import HsSyn import RdrHsSyn @@ -28,10 +28,11 @@ import RnMonad import ErrUtils ( addErrLoc, addShortErrLocLine ) import Name ( isLocallyDefinedName, pprSym, Name, RdrName ) import Pretty -import UniqFM ( lookupUFM ) +import UniqFM ( lookupUFM{-, ufmToList ToDo:rm-} ) import UniqSet ( emptyUniqSet, unitUniqSet, unionUniqSets, unionManyUniqSets, - UniqSet(..) ) + SYN_IE(UniqSet) + ) import Util ( Ord3(..), removeDups, panic ) \end{code} @@ -227,8 +228,8 @@ rnExpr (OpApp e1 op e2) rnExpr (NegApp e n) = rnExpr e `thenRn` \ (e', fvs_e) -> - lookupValue n `thenRn` \ nname -> - returnRn (NegApp e' nname, fvs_e `unionUniqSets` fv_set nname) + rnExpr n `thenRn` \ (n', fvs_n) -> + returnRn (NegApp e' n', fvs_e `unionUniqSets` fvs_n) rnExpr (HsPar e) = rnExpr e `thenRn` \ (e', fvs_e) -> @@ -368,7 +369,7 @@ rnRpats rpats %************************************************************************ %* * -\subsubsection{@Qual@s: in list comprehensions} +\subsubsection{@Qualifier@s: in list comprehensions} %* * %************************************************************************ @@ -394,7 +395,7 @@ rnQuals (qual: quals) = rnQual qual `thenRn` \ ((qual', bs1), fvQuals1) -> extendSS2 bs1 (rnQuals quals) `thenRn` \ ((quals', bs2), fvQuals2) -> returnRn - ((qual' : quals', bs2 ++ bs1), -- The ones on the right (bs2) shadow the + ((qual' : quals', bs1 ++ bs2), -- The ones on the right (bs2) shadow the -- ones on the left (bs1) fvQuals1 `unionUniqSets` fvQuals2) @@ -485,7 +486,8 @@ precParseExpr exp@(OpApp (NegApp e1 n) (HsVar op) e2) precParseExpr exp@(OpApp (OpApp e11 (HsVar op1) e12) (HsVar op) e2) = lookupFixity op `thenRn` \ (op_fix, op_prec) -> lookupFixity op1 `thenRn` \ (op1_fix, op1_prec) -> - case cmp op1_prec op_prec of + -- pprTrace "precParse:" (ppCat [ppr PprDebug op, ppInt op_prec, ppr PprDebug op1, ppInt op1_prec]) $ + case (op1_prec `cmp` op_prec) of LT_ -> rearrange EQ_ -> case (op1_fix, op_fix) of (INFIXR, INFIXR) -> rearrange @@ -513,7 +515,7 @@ precParsePat pat@(ConOpPatIn (NegPatIn e1) op e2) precParsePat pat@(ConOpPatIn (ConOpPatIn p11 op1 p12) op p2) = lookupFixity op `thenRn` \ (op_fix, op_prec) -> lookupFixity op1 `thenRn` \ (op1_fix, op1_prec) -> - case cmp op1_prec op_prec of + case (op1_prec `cmp` op_prec) of LT_ -> rearrange EQ_ -> case (op1_fix, op_fix) of (INFIXR, INFIXR) -> rearrange @@ -534,6 +536,7 @@ data INFIX = INFIXL | INFIXR | INFIXN deriving Eq lookupFixity :: RnName -> RnM_Fixes s (INFIX, Int) lookupFixity op = getExtraRn `thenRn` \ fixity_fm -> + -- pprTrace "lookupFixity:" (ppAboves [ppCat [pprUnique u, ppr PprDebug i_f] | (u,i_f) <- ufmToList fixity_fm]) $ case lookupUFM fixity_fm op of Nothing -> returnRn (INFIXL, 9) Just (InfixL _ n) -> returnRn (INFIXL, n)