mirror of
https://github.com/github/semantic.git
synced 2024-12-22 06:11:49 +03:00
Facror the common part of runGraph out.
This commit is contained in:
parent
3b2bda990f
commit
3dcc0de5b2
@ -122,16 +122,14 @@ runGraph :: ( Member Distribute sig
|
||||
-> Project
|
||||
-> m (Graph ControlFlowVertex)
|
||||
runGraph type' includePackages project
|
||||
| SomeAnalysisParser parser (lang :: Proxy lang) <- someAnalysisParser (Proxy @AnalyzeTerm) (projectLanguage project) = case type' of
|
||||
ImportGraph -> do
|
||||
| SomeAnalysisParser parser (lang :: Proxy lang) <- someAnalysisParser (Proxy @AnalyzeTerm) (projectLanguage project) = do
|
||||
let parse = if projectLanguage project == Language.Python then parsePythonPackage parser else fmap (fmap snd) . parsePackage parser
|
||||
package <- parse project
|
||||
runImportGraphToModuleInfos lang package
|
||||
CallGraph -> do
|
||||
let parse = if projectLanguage project == Language.Python then parsePythonPackage parser else fmap (fmap snd) . parsePackage parser
|
||||
package <- parse project
|
||||
modules <- topologicalSort <$> runImportGraphToModules lang package
|
||||
runCallGraph lang includePackages modules package
|
||||
case type' of
|
||||
ImportGraph -> runImportGraphToModuleInfos lang package
|
||||
CallGraph -> do
|
||||
modules <- topologicalSort <$> runImportGraphToModules lang package
|
||||
runCallGraph lang includePackages modules package
|
||||
|
||||
runCallGraph :: ( AnalyzeTerm term
|
||||
, HasPrelude lang
|
||||
|
Loading…
Reference in New Issue
Block a user