mirror of
https://github.com/github/semantic.git
synced 2024-12-27 17:05:33 +03:00
Filter Export edges so we don't traverse them in the tests
This commit is contained in:
parent
13802ab4b1
commit
b2bbd0e78c
@ -31,6 +31,7 @@ module Data.Abstract.ScopeGraph
|
|||||||
import Control.Abstract.Hole
|
import Control.Abstract.Hole
|
||||||
import Data.Abstract.Name
|
import Data.Abstract.Name
|
||||||
import qualified Data.Map.Strict as Map
|
import qualified Data.Map.Strict as Map
|
||||||
|
import qualified Data.Set as Set
|
||||||
import Data.Span
|
import Data.Span
|
||||||
import Prelude hiding (lookup)
|
import Prelude hiding (lookup)
|
||||||
import Prologue
|
import Prologue
|
||||||
@ -191,7 +192,7 @@ lookupDeclaration declaration scope g = do
|
|||||||
|
|
||||||
declarationNames :: Ord address => Scope address -> ScopeGraph address -> [Declaration]
|
declarationNames :: Ord address => Scope address -> ScopeGraph address -> [Declaration]
|
||||||
declarationNames scope scopeGraph = localDeclarations <> edgeNames
|
declarationNames scope scopeGraph = localDeclarations <> edgeNames
|
||||||
where addresses = join (Map.elems (edges scope))
|
where addresses = join (Map.elems $ Map.withoutKeys (edges scope) (Set.singleton Export))
|
||||||
edgeNames = addresses >>= toList . flip lookupScope scopeGraph >>= flip declarationNames scopeGraph
|
edgeNames = addresses >>= toList . flip lookupScope scopeGraph >>= flip declarationNames scopeGraph
|
||||||
localDeclarations = toList . fmap fst $ declarations scope
|
localDeclarations = toList . fmap fst $ declarations scope
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user