1
1
mirror of https://github.com/github/semantic.git synced 2025-01-06 23:46:21 +03:00

Need to pass address to namespace for now

This commit is contained in:
joshvera 2018-09-20 12:08:32 -04:00
parent 8fa5c283cf
commit 0d4c32f3d3

View File

@ -28,7 +28,8 @@ module Control.Abstract.Value
import Control.Abstract.ScopeGraph (Declaration) import Control.Abstract.ScopeGraph (Declaration)
import Control.Abstract.Environment import Control.Abstract.Environment
import Control.Abstract.Evaluator import Control.Abstract.Evaluator
import Control.Abstract.Heap import Control.Abstract.Heap hiding (address)
import qualified Control.Abstract.Heap as Heap
import Data.Abstract.Environment as Env import Data.Abstract.Environment as Env
import Data.Abstract.BaseError import Data.Abstract.BaseError
import Data.Abstract.Module import Data.Abstract.Module
@ -250,14 +251,14 @@ makeNamespace :: ( AbstractValue address value effects
, Ord address , Ord address
) )
=> Declaration => Declaration
-> address -> Address address
-> Maybe address -> Maybe (Address address)
-> Evaluator address value effects () -> Evaluator address value effects ()
-> Evaluator address value effects value -> Evaluator address value effects value
makeNamespace declaration addr super body = do makeNamespace declaration addr super body = do
namespaceBinds <- Env.head <$> locally (body >> getEnv) namespaceBinds <- Env.head <$> locally (body >> getEnv)
v <- namespace declaration super namespaceBinds v <- namespace declaration (Heap.address <$> super) namespaceBinds
v <$ assign addr declaration v v <$ assign addr v
-- | Evaluate a term within the context of the scoped environment of 'scopedEnvTerm'. -- | Evaluate a term within the context of the scoped environment of 'scopedEnvTerm'.