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

currentScope' always returns an address now

This commit is contained in:
joshvera 2018-09-26 13:57:46 -05:00
parent 910ba23e6a
commit be44a501e0

View File

@ -114,12 +114,10 @@ instance (Member (Reader ModuleInfo) effects, Member (Resumable (BaseError (Scop
span <- ask @Span -- TODO: This span is probably wrong
currentScope' <- currentScope
address <- declare (Declaration name) span Nothing
let edges = maybe mempty (Map.singleton Lexical . pure) currentScope'
let edges = Map.singleton Lexical [ currentScope' ]
functionScope <- newScope edges
currentFrame' <- currentFrame
let frameEdges = case currentScope' of
Just scope -> Map.singleton Lexical (Map.singleton scope currentFrame')
Nothing -> mempty
let frameEdges = Map.singleton Lexical (Map.singleton currentScope' currentFrame')
functionFrame <- newFrame functionScope frameEdges
withScopeAndFrame functionFrame $ do
function name vars lowerBound action