From 6c612a987c7770096b7ccd41379ad6cbba3c9b17 Mon Sep 17 00:00:00 2001 From: joshvera Date: Mon, 11 Feb 2019 14:35:35 -0500 Subject: [PATCH] Die in evaluateProjectForScopeGraph for now --- src/Semantic/Util.hs | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/Semantic/Util.hs b/src/Semantic/Util.hs index 2e7b1d438..1032abb89 100644 --- a/src/Semantic/Util.hs +++ b/src/Semantic/Util.hs @@ -176,17 +176,20 @@ evaluatePythonProjects proxy parser lang path = runTask' $ do (raiseHandler (runReader (lowerBound @Span)) (evaluate proxy (runDomainEffects (evalTerm withTermSpans)) modules))))))) -evaluateProjectForScopeGraph proxy parser project = runTaskWithOptions debugOptions $ do - package <- fmap quieterm <$> parsePythonPackage parser project - modules <- topologicalSort <$> runImportGraphToModules proxy package - trace $ "evaluating with load order: " <> show (map (modulePath . moduleInfo) modules) - pure (id @(Evaluator _ (Hole.Hole (Maybe Name) Precise) (Value _ (Hole.Hole (Maybe Name) Precise)) _ _) - (runModuleTable - (runModules (ModuleTable.modulePaths (packageModules package)) - (raiseHandler (runReader (packageInfo package)) - (raiseHandler (evalState (lowerBound @Span)) - (raiseHandler (runReader (lowerBound @Span)) - (evaluate proxy (runDomainEffects (evalTerm withTermSpans)) modules))))))) +evaluateProjectForScopeGraph proxy parser project = do + res <- runTaskWithOptions debugOptions $ do + package <- fmap quieterm <$> parsePythonPackage parser project + modules <- topologicalSort <$> runImportGraphToModules proxy package + trace $ "evaluating with load order: " <> show (map (modulePath . moduleInfo) modules) + pure (id @(Evaluator _ (Hole.Hole (Maybe Name) Precise) (Value _ (Hole.Hole (Maybe Name) Precise)) _ _) + (runModuleTable + (runModules (ModuleTable.modulePaths (packageModules package)) + (raiseHandler (runReader (packageInfo package)) + (raiseHandler (evalState (lowerBound @Span)) + (raiseHandler (runReader (lowerBound @Span)) + (evaluate proxy (runDomainEffects (evalTerm withTermSpans)) modules))))))) + either (die . displayException) pure res + evaluateProjectWithCaching proxy parser path = runTask' $ do project <- readProject Nothing path (Language.reflect proxy) []