X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fparser%2FParser.y.pp;h=32ab9915a938b6b4d911915190ec5b1711a192e7;hb=e4417dcd4679da9c6b18c02ff667199c572bed89;hp=8c4b03fb21a51729cafe2f998fbb58fcaa82045a;hpb=351e8d3641128e37d32dd35179a19c0b3350661b;p=ghc-hetmet.git diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp index 8c4b03f..32ab991 100644 --- a/compiler/parser/Parser.y.pp +++ b/compiler/parser/Parser.y.pp @@ -824,7 +824,7 @@ where_inst :: { Located (OrdList (LHsDecl RdrName)) } -- Reversed decls :: { Located (OrdList (LHsDecl RdrName)) } : decls ';' decl { let { this = unLoc $3; rest = unLoc $1; - these = unLoc $1 `appOL` unLoc $3 } + these = rest `appOL` this } in rest `seq` this `seq` these `seq` LL these } | decls ';' { LL (unLoc $1) } @@ -1231,7 +1231,7 @@ decl :: { Located (OrdList (LHsDecl RdrName)) } | docdecl { LL $ unitOL $1 } rhs :: { Located (GRHSs RdrName) } - : '=' exp wherebinds { L (comb3 $1 $2 $3) $ GRHSs (unguardedRHS $2) (unLoc $3) } + : '=' exp wherebinds { sL (comb3 $1 $2 $3) $ GRHSs (unguardedRHS $2) (unLoc $3) } | gdrhs wherebinds { LL $ GRHSs (reverse (unLoc $1)) (unLoc $2) } gdrhs :: { Located [LGRHS RdrName] } @@ -1441,7 +1441,7 @@ list :: { LHsExpr RdrName } | texp '|' flattenedpquals { sL (comb2 $1 $>) $ mkHsDo ListComp (unLoc $3) $1 } lexps :: { Located [LHsExpr RdrName] } - : lexps ',' texp { LL ($3 : unLoc $1) } + : lexps ',' texp { LL (((:) $! $3) $! unLoc $1) } | texp ',' texp { LL [$3,$1] } ----------------------------------------------------------------------------- @@ -1971,14 +1971,16 @@ getDOCSECTION (L _ (ITdocSection n x)) = (n, x) -- Utilities for combining source spans comb2 :: Located a -> Located b -> SrcSpan -comb2 = combineLocs +comb2 a b = a `seq` b `seq` combineLocs a b comb3 :: Located a -> Located b -> Located c -> SrcSpan -comb3 a b c = combineSrcSpans (getLoc a) (combineSrcSpans (getLoc b) (getLoc c)) +comb3 a b c = a `seq` b `seq` c `seq` + combineSrcSpans (getLoc a) (combineSrcSpans (getLoc b) (getLoc c)) comb4 :: Located a -> Located b -> Located c -> Located d -> SrcSpan -comb4 a b c d = combineSrcSpans (getLoc a) $ combineSrcSpans (getLoc b) $ - combineSrcSpans (getLoc c) (getLoc d) +comb4 a b c d = a `seq` b `seq` c `seq` d `seq` + (combineSrcSpans (getLoc a) $ combineSrcSpans (getLoc b) $ + combineSrcSpans (getLoc c) (getLoc d)) -- strict constructor version: {-# INLINE sL #-}