From 1b9841866c2b49484a3af10ab2d8f5bb6d68ab84 Mon Sep 17 00:00:00 2001 From: simonmar Date: Fri, 10 Sep 2004 13:58:55 +0000 Subject: [PATCH] [project @ 2004-09-10 13:58:55 by simonmar] Another SrcSpan fix: the span of a Match now covers the entire equation, not just the rhs. --- ghc/compiler/parser/RdrHsSyn.lhs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ghc/compiler/parser/RdrHsSyn.lhs b/ghc/compiler/parser/RdrHsSyn.lhs index 6fb6e86..b51c2d5 100644 --- a/ghc/compiler/parser/RdrHsSyn.lhs +++ b/ghc/compiler/parser/RdrHsSyn.lhs @@ -771,10 +771,14 @@ checkValDef lhs opt_sig (L rhs_span grhss) then parseError (getLoc f) ("Qualified name in function definition: " ++ showRdrName (unLoc f)) else do ps <- checkPatterns es - return (FunBind f inf [L rhs_span (Match ps opt_sig grhss)]) + let match_span = combineSrcSpans (getLoc lhs) rhs_span + return (FunBind f inf [L match_span (Match ps opt_sig grhss)]) + -- the span of the match covers the entire equation. That isn't + -- quite right, but it'll do for now. | otherwise = do lhs <- checkPattern lhs return (PatBind lhs grhss) + checkValSig :: LHsExpr RdrName -- 1.7.10.4