Commit f904833c authored by simonpj's avatar simonpj

[project @ 2004-05-06 12:25:49 by simonpj]

Fix (head []) value for src span in mkSimpleMatch
parent a731a252
......@@ -54,8 +54,12 @@ mkHsPar e = L (getLoc e) (HsPar e)
mkSimpleMatch :: [LPat id] -> LHsExpr id -> Type -> LMatch id
mkSimpleMatch pats rhs rhs_ty
= addCLoc (head pats) rhs $
= L loc $
Match pats Nothing (GRHSs (unguardedRHS rhs) [] rhs_ty)
where
loc = case pats of
[] -> getLoc rhs
(pat:_) -> combineSrcSpans (getLoc pat) (getLoc rhs)
unguardedRHS :: LHsExpr id -> [LGRHS id]
unguardedRHS rhs@(L loc _) = [L loc (GRHS [L loc (ResultStmt rhs)])]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment