mirror of
https://github.com/github/semantic.git
synced 2024-12-30 02:14:20 +03:00
lints
This commit is contained in:
parent
a4f84f4371
commit
8e1e9579da
@ -73,7 +73,7 @@ instance Effect (ScopeEnv address) where
|
||||
runScopeEnv :: (Ord address, Effects effects, Member Fresh effects, Member (Allocator address) effects)
|
||||
=> Evaluator address value (ScopeEnv address ': effects) a
|
||||
-> Evaluator address value effects (ScopeGraph address, a)
|
||||
runScopeEnv evaluator = runState (ScopeGraph.emptyGraph) (reinterpret handleScopeEnv evaluator)
|
||||
runScopeEnv evaluator = runState ScopeGraph.emptyGraph (reinterpret handleScopeEnv evaluator)
|
||||
|
||||
handleScopeEnv :: forall address value effects a. (Ord address, Member Fresh effects, Member (Allocator address) effects, Effects effects)
|
||||
=> ScopeEnv address (Eff (ScopeEnv address ': effects)) a
|
||||
|
@ -1,4 +1,4 @@
|
||||
{-# LANGUAGE GADTs, GeneralizedNewtypeDeriving #-}
|
||||
{-# LANGUAGE GADTs #-}
|
||||
module Data.Abstract.ScopeGraph
|
||||
( ScopeGraph(..)
|
||||
, Path
|
||||
@ -75,7 +75,7 @@ declare declaration ddata assocScope g@ScopeGraph{..} = fromMaybe g $ do
|
||||
scopeKey <- currentScope
|
||||
scope <- lookupScope scopeKey g
|
||||
let newScope = scope { declarations = Map.insert declaration (ddata, assocScope) (declarations scope) }
|
||||
pure $ g { graph = (Map.insert scopeKey newScope graph) }
|
||||
pure $ g { graph = Map.insert scopeKey newScope graph }
|
||||
|
||||
reference :: Ord scope => Reference -> Declaration -> ScopeGraph scope -> ScopeGraph scope
|
||||
reference ref declaration g@ScopeGraph{..} = fromMaybe g $ do
|
||||
|
@ -215,7 +215,7 @@ instance Evaluatable Class where
|
||||
scope <- associatedScope (Declaration name)
|
||||
(scope,) <$> subtermAddress superclass
|
||||
|
||||
let imports = ((I,) <$> (fmap pure . catMaybes $ fst <$> supers))
|
||||
let imports = (I,) <$> (fmap pure . catMaybes $ fst <$> supers)
|
||||
current = maybe mempty (fmap (P, ) . pure . pure) currentScope'
|
||||
edges = Map.fromList (imports <> current)
|
||||
childScope <- newScope edges
|
||||
|
@ -143,7 +143,7 @@ instance Evaluatable Assignment where
|
||||
|
||||
case lhs of
|
||||
LvalLocal name -> do
|
||||
case (declaredName (subterm assignmentValue)) of
|
||||
case declaredName (subterm assignmentValue) of
|
||||
Just rhsName -> do
|
||||
assocScope <- associatedScope (Declaration rhsName)
|
||||
let edges = maybe mempty (Map.singleton I . pure) assocScope
|
||||
|
@ -366,7 +366,7 @@ instance Show1 ExtendsClause where liftShowsPrec = genericLiftShowsPrec
|
||||
instance Evaluatable ExtendsClause where
|
||||
eval ExtendsClause{..} = do
|
||||
-- Evaluate subterms
|
||||
_ <- traverse subtermRef extendsClauses
|
||||
traverse_ subtermRef extendsClauses
|
||||
rvalBox unit
|
||||
|
||||
newtype ArrayType a = ArrayType { arrayType :: a }
|
||||
|
Loading…
Reference in New Issue
Block a user