1
1
mirror of https://github.com/github/semantic.git synced 2024-12-27 00:44:57 +03:00

🔥 some redundant qualifiers.

This commit is contained in:
Rob Rix 2019-11-04 13:38:12 -05:00
parent 8127690358
commit ec53cd91d6
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7
3 changed files with 9 additions and 9 deletions

View File

@ -6,7 +6,7 @@ module Analysis.ImportGraph
) where
import Analysis.Analysis
import Analysis.Carrier.Env.Monovariant as A
import Analysis.Carrier.Env.Monovariant
import Analysis.File
import Analysis.FlowInsensitive
import Control.Applicative (Alternative(..))
@ -120,7 +120,7 @@ importGraphAnalysis = Analysis{..}
apply eval (Value (Closure path span name body) _) a = local (const path) . local (const span) $ do
addr <- alloc @name @name name
assign addr a
A.bind name addr (eval body)
bind name addr (eval body)
apply _ f _ = fail $ "Cannot coerce " <> show f <> " to function"
unit = pure mempty
bool _ = pure mempty
@ -130,7 +130,7 @@ importGraphAnalysis = Analysis{..}
asString _ = pure mempty
record fields = do
for_ fields $ \ (k, v) -> do
addr <- A.alloc @name @name k
addr <- alloc @name @name k
assign addr v
pure (Value Abstract (foldMap (valueGraph . snd) fields))
_ ... m = pure (Just m)

View File

@ -8,7 +8,7 @@ module Analysis.ScopeGraph
) where
import Analysis.Analysis
import Analysis.Carrier.Env.Monovariant as A
import Analysis.Carrier.Env.Monovariant
import Analysis.File
import Analysis.FlowInsensitive
import Control.Applicative (Alternative (..))
@ -117,9 +117,9 @@ scopeGraphAnalysis = Analysis{..}
bindRef <- asks (Map.lookup addr)
modify (Map.insertWith (<>) addr (Set.singleton (extendBinding addr ref bindRef <> v)))
abstract eval name body = do
addr <- A.alloc @name @name name
addr <- alloc @name @name name
assign name mempty
A.bind name addr (eval body)
bind name addr (eval body)
apply _ f a = pure (f <> a)
unit = pure mempty
bool _ = pure mempty

View File

@ -8,7 +8,7 @@ module Analysis.Typecheck
) where
import Analysis.Analysis
import Analysis.Carrier.Env.Monovariant as A
import Analysis.Carrier.Env.Monovariant
import Analysis.File
import Analysis.FlowInsensitive
import Control.Applicative (Alternative (..))
@ -167,7 +167,7 @@ typecheckingAnalysis = Analysis{..}
assign addr ty = modify (Map.insertWith (<>) addr (Set.singleton ty))
abstract eval name body = do
-- FIXME: construct the associated scope
addr <- A.alloc @name @name name
addr <- alloc @name @name name
arg <- meta
assign addr arg
ty <- eval body
@ -185,7 +185,7 @@ typecheckingAnalysis = Analysis{..}
asString s = unify (Alg String) s $> mempty
record fields = do
fields' <- for fields $ \ (k, v) -> do
addr <- A.alloc @name @name k
addr <- alloc @name @name k
(k, v) <$ assign addr v
-- FIXME: should records reference types by address instead?
pure (Alg (Record (Map.fromList fields')))