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,14 +122,12 @@ 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
|
||||
case type' of
|
||||
ImportGraph -> 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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user