mirror of
https://github.com/github/semantic.git
synced 2024-12-20 13:21:59 +03:00
Don't construct new scopes for every local assignment
Only construct a new scope for a local assignment if its rhs has an associated scope.
This commit is contained in:
parent
659c51305f
commit
82b6b7c52e
@ -146,9 +146,11 @@ instance Evaluatable Assignment where
|
||||
case declaredName (subterm assignmentValue) of
|
||||
Just rhsName -> do
|
||||
assocScope <- associatedScope (Declaration rhsName)
|
||||
let edges = maybe mempty (Map.singleton I . pure) assocScope
|
||||
objectScope <- newScope edges
|
||||
putDeclarationScope (Declaration name) objectScope
|
||||
case assocScope of
|
||||
Just assocScope' -> do
|
||||
objectScope <- newScope (Map.singleton I [ assocScope' ])
|
||||
putDeclarationScope (Declaration name) objectScope
|
||||
Nothing -> pure ()
|
||||
Nothing ->
|
||||
-- The rhs wasn't assigned to a reference/declaration.
|
||||
pure ()
|
||||
|
Loading…
Reference in New Issue
Block a user