1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00

Import graphs don’t need to collect the set of addresses in scope when abstracting.

This commit is contained in:
Rob Rix 2019-07-29 12:11:54 -04:00
parent 9acaaaedc0
commit 65e218417f
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -43,7 +43,7 @@ instance Monoid Value where
mempty = Value Abstract mempty
data Semi
= Closure Loc User (Term (Core.Ann :+: Core.Core) User) (Set.Set User)
= Closure Loc User (Term (Core.Ann :+: Core.Core) User)
-- FIXME: Bound String values.
| String Text
| Abstract
@ -86,9 +86,8 @@ importGraphAnalysis = Analysis{..}
assign addr ty = modify (Map.insertWith (<>) addr (Set.singleton ty))
abstract _ name body = do
loc <- ask
env <- gets @(Heap User Value) Map.keysSet
pure (Value (Closure loc name body env) mempty)
apply eval (Value (Closure loc name body _) _) a = local (const loc) $ do
pure (Value (Closure loc name body) mempty)
apply eval (Value (Closure loc name body) _) a = local (const loc) $ do
addr <- alloc name
assign addr a
bind name addr (eval body)