From c32bcc884fdcf64f04adb10ff1307d0561a6fb6f Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 18 Oct 2019 14:22:42 -0400 Subject: [PATCH] Define an AnalyzeTerm instance. --- src/Semantic/Graph.hs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Semantic/Graph.hs b/src/Semantic/Graph.hs index a83d6b8d6..83a9f7640 100644 --- a/src/Semantic/Graph.hs +++ b/src/Semantic/Graph.hs @@ -55,11 +55,12 @@ import Data.Abstract.Value.Type as Type import Data.Abstract.AccessControls.Instances () import Data.Blob import Data.Graph -import Data.Graph.ControlFlowVertex (VertexDeclaration) +import Data.Graph.ControlFlowVertex (VertexDeclaration, VertexDeclaration1) import Data.Language as Language import Data.List (isPrefixOf, isSuffixOf) import qualified Data.Map as Map import Data.Project +import Data.Term import Data.Text (pack, unpack) import Language.Haskell.HsColour import Language.Haskell.HsColour.Colourise @@ -110,6 +111,17 @@ class , HasSpan (term Loc) ) => AnalyzeTerm (term :: * -> *) +instance + ( VertexDeclaration1 syntax + , Declarations1 syntax + , Evaluatable syntax + , FreeVariables1 syntax + , AccessControls1 syntax + , Functor syntax + , Ord1 syntax + , Show1 syntax + ) => AnalyzeTerm (Term syntax) + analysisParsers :: Map Language (SomeParser AnalyzeTerm Loc) analysisParsers = Map.fromList [ goParser'