1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 01:47:01 +03:00

🔥 askLoc.

This commit is contained in:
Rob Rix 2019-10-10 13:49:36 -04:00
parent ef36ded16c
commit f15feb0ca3
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -102,7 +102,7 @@ scopeGraphAnalysis
scopeGraphAnalysis = Analysis{..}
where alloc = pure
bind name _ m = do
loc <- askLoc
loc <- Loc <$> ask <*> ask
local (Map.insert name loc) m
lookupEnv = pure . Just
deref addr = do
@ -136,6 +136,5 @@ scopeGraphAnalysis = Analysis{..}
_ ... m = pure (Just m)
askRef = Ref <$> ask <*> ask
askLoc = Loc <$> ask <*> ask
extendBinding addr ref bindLoc = ScopeGraph (maybe Map.empty (\ (Loc path span) -> Map.singleton (Decl addr path span) (Set.singleton ref)) bindLoc)