1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 09:15:01 +03:00

Scope graphing takes addressed terms.

This commit is contained in:
Rob Rix 2019-12-19 12:58:43 -05:00
parent da63c0cf6a
commit d93686e01e
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -49,13 +49,13 @@ instance Ord name => Monoid (ScopeGraph name) where
mempty = ScopeGraph Map.empty
scopeGraph
:: Ord (term Name)
:: Ord (term Addr)
=> (forall sig m
. (Has (Reader Path.AbsRelFile) sig m, Has (Reader Span) sig m, MonadFail m)
=> (term Name -> m (ScopeGraph Name))
-> (term Name -> m (ScopeGraph Name))
=> (term Addr -> m (ScopeGraph Name))
-> (term Addr -> m (ScopeGraph Name))
)
-> [File (term Name)]
-> [File (term Addr)]
-> (Heap (ScopeGraph Name), [File (Either (Path.AbsRelFile, Span, String) (ScopeGraph Name))])
scopeGraph eval
= run
@ -67,14 +67,14 @@ runFile
:: ( Effect sig
, Has Fresh sig m
, Has (State (Heap (ScopeGraph Name))) sig m
, Ord (term Name)
, Ord (term Addr)
)
=> (forall sig m
. (Has (Reader Path.AbsRelFile) sig m, Has (Reader Span) sig m, MonadFail m)
=> (term Name -> m (ScopeGraph Name))
-> (term Name -> m (ScopeGraph Name))
=> (term Addr -> m (ScopeGraph Name))
-> (term Addr -> m (ScopeGraph Name))
)
-> File (term Name)
-> File (term Addr)
-> m (File (Either (Path.AbsRelFile, Span, String) (ScopeGraph Name)))
runFile eval file = traverse run file
where run = runReader (filePath file)