1
1
mirror of https://github.com/github/semantic.git synced 2024-11-23 08:27:56 +03:00

Future proof.

This commit is contained in:
Rob Rix 2022-04-14 09:51:08 -04:00
parent 9cb6556499
commit c367494e4b
No known key found for this signature in database
GPG Key ID: 2BE643E01DC032AE

View File

@ -143,7 +143,7 @@ newReference name props = do
CurrentScope currentAddress <- currentScope CurrentScope currentAddress <- currentScope
scope <- lookupScope currentAddress scope <- lookupScope currentAddress
let refProps = Reference.ReferenceInfo (props^.span_) (Props.Reference.kind props) lowerBound let refProps = Reference.ReferenceInfo (props ^. span_) (Props.Reference.kind props) lowerBound
insertRef' :: ScopeGraph.Path Name -> ScopeGraph.ScopeGraph Name -> ScopeGraph.ScopeGraph Name insertRef' :: ScopeGraph.Path Name -> ScopeGraph.ScopeGraph Name -> ScopeGraph.ScopeGraph Name
insertRef' path scopeGraph = let insertRef' path scopeGraph = let
scope' = (ScopeGraph.insertReference (Reference.Reference name) lowerBound (Props.Reference.span props) (getField @"kind" props) path) scope scope' = (ScopeGraph.insertReference (Reference.Reference name) lowerBound (Props.Reference.span props) (getField @"kind" props) path) scope
@ -179,9 +179,9 @@ declareMaybeName :: ScopeGraphEff sig m
=> Maybe Name => Maybe Name
-> Props.Declaration -> Props.Declaration
-> m Name -> m Name
declareMaybeName maybeName props = do declareMaybeName maybeName props@(Props.Declaration kind _ associatedScope span) = do
case maybeName of case maybeName of
Just name -> name <$ declare name props Just name -> name <$ declare name props
_ -> do _ -> do
name <- Name.gensym name <- Name.gensym
name <$ declare name (props { Props.relation = ScopeGraph.Gensym }) name <$ declare name (Props.Declaration kind ScopeGraph.Gensym associatedScope span)