1
1
mirror of https://github.com/github/semantic.git synced 2024-12-19 12:51:52 +03:00

Abstract graphingTerms over the term type.

This commit is contained in:
Rob Rix 2019-10-18 13:44:50 -04:00
parent 337ef7fac2
commit 1a99c7fc7f
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -20,17 +20,14 @@ import Algebra.Graph.Export.Dot hiding (vertexName)
import Control.Abstract hiding (Function(..))
import Control.Effect.Carrier
import Data.Abstract.BaseError
import Data.Abstract.Declarations
import Data.Abstract.Module (Module (moduleInfo), ModuleInfo (..))
import Data.Abstract.Package (PackageInfo (..))
import Data.ByteString.Builder
import Data.Graph
import Data.Graph.ControlFlowVertex
import Data.Term
import qualified Data.Map as Map
import qualified Data.Text.Encoding as T
import Prologue
import Source.Loc
style :: Style ControlFlowVertex Builder
style = (defaultStyle (T.encodeUtf8Builder . vertexIdentifier))
@ -70,12 +67,11 @@ graphingTerms :: ( Member (Reader ModuleInfo) sig
, Member (Reader (CurrentFrame address)) sig
, Member (Reader (CurrentScope address)) sig
, Member (Reader ControlFlowVertex) sig
, VertexDeclaration1 syntax
, Declarations1 syntax
, VertexDeclaration term
, Ord address
, Carrier sig m
)
=> Open (Term syntax Loc -> Evaluator (Term syntax Loc) address value m a)
=> Open (term -> Evaluator term address value m a)
graphingTerms recur term = do
definedInModule <- currentModule
case toVertex definedInModule term of