From c61c592ef658a56a45461f1c9eea5384c3350aee Mon Sep 17 00:00:00 2001 From: joshvera Date: Thu, 13 Sep 2018 18:27:19 -0400 Subject: [PATCH] Prefer import edges over parent edges --- src/Data/Abstract/ScopeGraph.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Data/Abstract/ScopeGraph.hs b/src/Data/Abstract/ScopeGraph.hs index bc19f02bb..580ddd5ce 100644 --- a/src/Data/Abstract/ScopeGraph.hs +++ b/src/Data/Abstract/ScopeGraph.hs @@ -95,7 +95,7 @@ reference ref declaration g@ScopeGraph{..} = fromMaybe g $ do scopes <- Map.lookup edge linkMap -- Return the first path to the declaration through the scopes. getFirst (foldMap (First . ap (go currentAddress currentScope) ((path .) . EPath edge)) scopes) - in traverseEdges P <|> traverseEdges I + in traverseEdges I <|> traverseEdges P create :: Ord address => address -> Map EdgeLabel [address] -> ScopeGraph address -> ScopeGraph address create address edges g@ScopeGraph{..} = g { graph = Map.insert address newScope graph, currentScope = Just address }