This commit is contained in:
Alan Zimmerman
2014-08-23 14:06:26 +02:00
parent 9101f306d1
commit 0944820dba
3 changed files with 12 additions and 14 deletions

View File

@@ -69,10 +69,10 @@ getSrcSpanTypeForSplit modSum lineNo colNo = do
-- Information for a function case split
getSrcSpanTypeForFnSplit :: GhcMonad m => G.ModSummary -> Int -> Int -> m (Maybe SplitInfo)
getSrcSpanTypeForFnSplit modSum lineNo colNo = do
p@ParsedModule{pm_parsed_source = pms} <- G.parseModule modSum
p@ParsedModule{pm_parsed_source = _pms} <- G.parseModule modSum
tcm@TypecheckedModule{tm_typechecked_source = tcs} <- G.typecheckModule p
let varPat = find isPatternVar $ listifySpans tcs (lineNo, colNo) :: Maybe (LPat Id)
match:_ = listifyParsedSpans pms (lineNo, colNo) :: [Gap.GLMatch]
match:_ = listifySpans tcs (lineNo, colNo) :: [Gap.GLMatchI]
case varPat of
Nothing -> return Nothing
Just varPat' -> do

View File

@@ -37,6 +37,7 @@ module Language.Haskell.GhcMod.Gap (
, benchmarkTargets
, toModuleString
, GLMatch
, GLMatchI
, getClass
, occName
, setFlags
@@ -437,8 +438,10 @@ toModuleString mn = fromFilePath $ M.toFilePath mn
#if __GLASGOW_HASKELL__ >= 708
type GLMatch = LMatch RdrName (LHsExpr RdrName)
type GLMatchI = LMatch Id (LHsExpr Id)
#else
type GLMatch = LMatch RdrName
type GLMatchI = LMatch Id
#endif
getClass :: [LInstDecl Name] -> Maybe (Name, SrcSpan)