Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit a73b267

Browse files
committed
Rename Entry to Decl.
1 parent ed94104 commit a73b267

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

semantic-core/src/Analysis/ScopeGraph.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{-# LANGUAGE FlexibleContexts, OverloadedStrings, RankNTypes, RecordWildCards, TypeApplications, TypeOperators #-}
22
module Analysis.ScopeGraph
33
( ScopeGraph(..)
4-
, Entry(..)
4+
, Decl(..)
55
, scopeGraph
66
, scopeGraphAnalysis
77
) where
@@ -27,16 +27,16 @@ import qualified Data.Set as Set
2727
import Data.Text (Text)
2828
import Prelude hiding (fail)
2929

30-
data Entry = Entry
31-
{ entrySymbol :: Text
32-
, entryLoc :: Loc
30+
data Decl = Decl
31+
{ declSymbol :: Text
32+
, declLoc :: Loc
3333
}
3434
deriving (Eq, Ord, Show)
3535

3636
newtype Ref = Ref Loc
3737
deriving (Eq, Ord, Show)
3838

39-
newtype ScopeGraph = ScopeGraph { unScopeGraph :: Map.Map Entry (Set.Set Ref) }
39+
newtype ScopeGraph = ScopeGraph { unScopeGraph :: Map.Map Decl (Set.Set Ref) }
4040
deriving (Eq, Ord, Show)
4141

4242
instance Semigroup ScopeGraph where
@@ -102,7 +102,7 @@ scopeGraphAnalysis = Analysis{..}
102102
ref <- asks Ref
103103
bindLoc <- asks (Map.lookup addr)
104104
cell <- gets (Map.lookup addr >=> nonEmpty . Set.toList)
105-
maybe (pure Nothing) (foldMapA (pure . Just . mappend (ScopeGraph (maybe Map.empty (\ bindLoc -> Map.singleton (Entry addr bindLoc) (Set.singleton ref)) bindLoc)))) cell
105+
maybe (pure Nothing) (foldMapA (pure . Just . mappend (ScopeGraph (maybe Map.empty (\ bindLoc -> Map.singleton (Decl addr bindLoc) (Set.singleton ref)) bindLoc)))) cell
106106
assign addr v = modify (Map.insertWith (<>) addr (Set.singleton v))
107107
abstract eval name body = do
108108
addr <- alloc name

0 commit comments

Comments
 (0)