sameFileName pos
(do e <- m; return (L pos e)) $ do
(fvs, e) <- getFreeVars m
- TM $ \ _env st ->
+ TM $ \ env st ->
let c = tickBoxCount st
ids = occEnvElts fvs
mes = mixEntries st
- me = (pos, declPath _env, map (nameOccName.idName) ids, boxLabel)
+ me = (pos, declPath env, map (nameOccName.idName) ids, boxLabel)
in
( L pos (HsTick c ids (L pos e))
, fvs
allocATickBox :: BoxLabel -> SrcSpan -> FreeVars -> TM (Maybe (Int,[Id]))
allocATickBox boxLabel pos fvs | isGoodSrcSpan' pos =
sameFileName pos
- (return Nothing) $ TM $ \ _env st ->
- let me = (pos, declPath _env, map (nameOccName.idName) ids, boxLabel)
+ (return Nothing) $ TM $ \ env st ->
+ let me = (pos, declPath env, map (nameOccName.idName) ids, boxLabel)
c = tickBoxCount st
mes = mixEntries st
ids = occEnvElts fvs
| isGoodSrcSpan' pos =
do
e <- m
- TM $ \ _env st ->
- let meT = (pos,declPath _env, [],boxLabel True)
- meF = (pos,declPath _env, [],boxLabel False)
- meE = (pos,declPath _env, [],ExpBox False)
+ TM $ \ env st ->
+ let meT = (pos,declPath env, [],boxLabel True)
+ meF = (pos,declPath env, [],boxLabel False)
+ meE = (pos,declPath env, [],ExpBox False)
c = tickBoxCount st
mes = mixEntries st
in
mkHistory :: HscEnv -> HValue -> BreakInfo -> History
mkHistory hsc_env hval bi = let
- decls = findEnclosingDecl hsc_env bi
+ decls = findEnclosingDecls hsc_env bi
in History hval bi decls
-- ToDo: a better way to do this would be to keep hold of the decl_path computed
-- by the coverage pass, which gives the list of lexically-enclosing bindings
-- for each tick.
-findEnclosingDecl :: HscEnv -> BreakInfo -> [String]
-findEnclosingDecl hsc_env inf =
- let hmi = expectJust "findEnclosingDecl" $
+findEnclosingDecls :: HscEnv -> BreakInfo -> [String]
+findEnclosingDecls hsc_env inf =
+ let hmi = expectJust "findEnclosingDecls" $
lookupUFM (hsc_HPT hsc_env) (moduleName $ breakInfo_module inf)
mb = getModBreaks hmi
in modBreaks_decls mb ! breakInfo_number inf