1
1
mirror of https://github.com/github/semantic.git synced 2024-12-20 13:21:59 +03:00

Use maybeLookupDeclaration

Since self isn't necessarily defined for all languages.
This commit is contained in:
joshvera 2018-12-13 17:49:43 -05:00
parent 9be3403d21
commit 493a69b8c5

View File

@ -111,8 +111,8 @@ instance ( FreeVariables term
withScopeAndFrame frameAddress $ do withScopeAndFrame frameAddress $ do
case maybeThis of case maybeThis of
Just object -> do Just object -> do
slot <- lookupDeclaration (Declaration __semantic_self) maybeSlot <- maybeLookupDeclaration (Declaration __semantic_self)
assign slot object maybe (pure ()) (`assign` object) maybeSlot
Nothing -> pure () Nothing -> pure ()
for_ (zip names params) $ \(name, param) -> do for_ (zip names params) $ \(name, param) -> do
addr <- lookupDeclaration (Declaration name) addr <- lookupDeclaration (Declaration name)