mirror of
https://github.com/github/semantic.git
synced 2024-12-30 02:14:20 +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
|
case declaredName (subterm assignmentValue) of
|
||||||
Just rhsName -> do
|
Just rhsName -> do
|
||||||
assocScope <- associatedScope (Declaration rhsName)
|
assocScope <- associatedScope (Declaration rhsName)
|
||||||
let edges = maybe mempty (Map.singleton I . pure) assocScope
|
case assocScope of
|
||||||
objectScope <- newScope edges
|
Just assocScope' -> do
|
||||||
|
objectScope <- newScope (Map.singleton I [ assocScope' ])
|
||||||
putDeclarationScope (Declaration name) objectScope
|
putDeclarationScope (Declaration name) objectScope
|
||||||
|
Nothing -> pure ()
|
||||||
Nothing ->
|
Nothing ->
|
||||||
-- The rhs wasn't assigned to a reference/declaration.
|
-- The rhs wasn't assigned to a reference/declaration.
|
||||||
pure ()
|
pure ()
|
||||||
|
Loading…
Reference in New Issue
Block a user