mirror of
https://github.com/github/semantic.git
synced 2024-11-24 08:54:07 +03:00
Lookup scopes while adding import edges
otherwise create intermediate scopes
This commit is contained in:
parent
d023a5e007
commit
c3c707cd6a
@ -360,8 +360,13 @@ addImportEdge edge names currentAddress g = do
|
||||
case names of
|
||||
(x :| []) -> addImportHole x currentAddress g
|
||||
(x :| xs) -> do
|
||||
let scopeGraph' = newScope x mempty g
|
||||
addImportEdge edge (NonEmpty.fromList xs) x scopeGraph'
|
||||
case lookupScope x g of
|
||||
Just _ -> addImportEdge edge (NonEmpty.fromList xs) x g
|
||||
Nothing ->
|
||||
let
|
||||
scopeGraph' = insertEdge edge x currentAddress (newScope x mempty g)
|
||||
in
|
||||
addImportEdge edge (NonEmpty.fromList xs) x scopeGraph'
|
||||
|
||||
|
||||
addImportHole :: Ord scopeAddress => scopeAddress -> scopeAddress -> ScopeGraph scopeAddress -> ScopeGraph scopeAddress
|
||||
|
Loading…
Reference in New Issue
Block a user