Analyse top-level pattern bindings (#93)

Fixes #92.
This commit is contained in:
amesgen 2021-12-08 15:58:59 +01:00 committed by GitHub
parent c19775085d
commit a05945bf77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -264,7 +264,8 @@ topLevelAnalysis n@Node{ nodeChildren } = do
analyseBinding :: ( Alternative m, MonadState Analysis m ) => HieAST a -> m () analyseBinding :: ( Alternative m, MonadState Analysis m ) => HieAST a -> m ()
analyseBinding n@Node{ nodeSpan, sourcedNodeInfo } = do analyseBinding n@Node{ nodeSpan, sourcedNodeInfo } = do
guard $ any (Set.member ("FunBind", "HsBindLR") . nodeAnnotations) $ getSourcedNodeInfo sourcedNodeInfo let bindAnns = Set.fromList [("FunBind", "HsBindLR"), ("PatBind", "HsBindLR")]
guard $ any (not . Set.disjoint bindAnns . nodeAnnotations) $ getSourcedNodeInfo sourcedNodeInfo
for_ ( findDeclarations n ) \d -> do for_ ( findDeclarations n ) \d -> do
define d nodeSpan define d nodeSpan