mirror of
https://github.com/github/semantic.git
synced 2024-12-22 14:21:31 +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
|
-> Project
|
||||||
-> m (Graph ControlFlowVertex)
|
-> m (Graph ControlFlowVertex)
|
||||||
runGraph type' includePackages project
|
runGraph type' includePackages project
|
||||||
| SomeAnalysisParser parser (lang :: Proxy lang) <- someAnalysisParser (Proxy @AnalyzeTerm) (projectLanguage project) = case type' of
|
| SomeAnalysisParser parser (lang :: Proxy lang) <- someAnalysisParser (Proxy @AnalyzeTerm) (projectLanguage project) = do
|
||||||
ImportGraph -> do
|
|
||||||
let parse = if projectLanguage project == Language.Python then parsePythonPackage parser else fmap (fmap snd) . parsePackage parser
|
let parse = if projectLanguage project == Language.Python then parsePythonPackage parser else fmap (fmap snd) . parsePackage parser
|
||||||
package <- parse project
|
package <- parse project
|
||||||
runImportGraphToModuleInfos lang package
|
case type' of
|
||||||
|
ImportGraph -> runImportGraphToModuleInfos lang package
|
||||||
CallGraph -> do
|
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
|
modules <- topologicalSort <$> runImportGraphToModules lang package
|
||||||
runCallGraph lang includePackages modules package
|
runCallGraph lang includePackages modules package
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user