1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 09:15:01 +03:00

fmap the topo sort over the import graph.

This commit is contained in:
Rob Rix 2018-06-22 16:00:36 -04:00
parent 903f048889
commit 346fad1097

View File

@ -99,23 +99,23 @@ typecheckGoFile = checking <=< evaluateProjectWithCaching (Proxy :: Proxy 'Langu
-- Evaluate a project consisting of the listed paths.
evaluateProject proxy parser lang paths = runTaskWithOptions debugOptions $ do
package <- fmap quieterm <$> parsePackage parser (Project (takeDirectory (maybe "/" fst (uncons paths))) (flip File lang <$> paths) lang [])
modules <- runImportGraph proxy package
modules <- topologicalSort <$> runImportGraph proxy package
pure (runTermEvaluator @_ @_ @(Value Precise (UtilEff Precise))
(runReader (packageInfo package)
(runReader (lowerBound @Span)
(runReader (lowerBound @(ModuleTable (NonEmpty (Module (Precise, Environment Precise)))))
(raiseHandler (runModules (ModuleTable.modulePaths (packageModules package)))
(evaluate proxy id withTermSpans (topologicalSort modules)))))))
(evaluate proxy id withTermSpans modules))))))
evaluateProjectWithCaching proxy parser lang path = runTaskWithOptions debugOptions $ do
project <- readProject Nothing path lang []
package <- fmap quieterm <$> parsePackage parser project
modules <- runImportGraph proxy package
modules <- topologicalSort <$> runImportGraph proxy package
pure (runReader (packageInfo package)
(runReader (lowerBound @Span)
(runReader (lowerBound @(ModuleTable (NonEmpty (Module (Monovariant, Environment Monovariant)))))
(raiseHandler (runModules (ModuleTable.modulePaths (packageModules package)))
(evaluate proxy id withTermSpans (topologicalSort modules))))))
(evaluate proxy id withTermSpans modules)))))
parseFile :: Parser term -> FilePath -> IO term