1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 08:54:07 +03:00

Rename TestEvaluatingResult to TestEvaluatingState and add an actual result synonym.

This commit is contained in:
Rob Rix 2019-10-23 10:27:38 -04:00
parent 6b6574eb56
commit 22f3440e0e
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -19,6 +19,7 @@ module SpecHelpers
, lookupMembers , lookupMembers
, EdgeLabel(..) , EdgeLabel(..)
, TestEvaluatingResult , TestEvaluatingResult
, TestEvaluatingState
, evaluateProject , evaluateProject
) where ) where
@ -143,14 +144,15 @@ type TestEvaluatingErrors term
, BaseError (UnspecializedError Precise (Val term)) , BaseError (UnspecializedError Precise (Val term))
, BaseError (LoadError Precise (Val term)) , BaseError (LoadError Precise (Val term))
] ]
type TestEvaluatingResult term a type TestEvaluatingState term a
= ( ScopeGraph Precise = ( ScopeGraph Precise
, ( Heap Precise Precise (Value term Precise) , ( Heap Precise Precise (Val term)
, Either (SomeError (Sum.Sum (TestEvaluatingErrors term))) a , Either (SomeError (Sum.Sum (TestEvaluatingErrors term))) a
) )
) )
type TestEvaluatingResult term = ModuleTable (Module (ModuleResult Precise (Val term)))
testEvaluating :: Evaluator term Precise (Val term) (TestEvaluatingC term) a testEvaluating :: Evaluator term Precise (Val term) (TestEvaluatingC term) a
-> IO (TestEvaluatingResult term a) -> IO (TestEvaluatingState term a)
testEvaluating testEvaluating
= runM = runM
. runTraceByIgnoring . runTraceByIgnoring
@ -170,7 +172,7 @@ testEvaluating
type Val term = Value term Precise type Val term = Value term Precise
evaluateProject :: (HasPrelude lang, SLanguage lang) => TaskSession -> Proxy lang -> [FilePath] -> IO (TestEvaluatingResult Any a) evaluateProject :: (HasPrelude lang, SLanguage lang) => TaskSession -> Proxy lang -> [FilePath] -> IO (TestEvaluatingState Any (TestEvaluatingResult Any))
evaluateProject session proxy = case Map.lookup lang analysisParsers of evaluateProject session proxy = case Map.lookup lang analysisParsers of
Just (SomeParser parser) -> unsafeCoerce . testEvaluating <=< evaluateProject' session proxy parser Just (SomeParser parser) -> unsafeCoerce . testEvaluating <=< evaluateProject' session proxy parser
_ -> error $ "analysis not supported for " <> show lang _ -> error $ "analysis not supported for " <> show lang