mirror of
https://github.com/github/semantic.git
synced 2024-12-26 08:25:19 +03:00
Define a type synonym for evaluating results.
This commit is contained in:
parent
fa02ff0a45
commit
0651d21e63
@ -18,6 +18,7 @@ module SpecHelpers
|
|||||||
, lookupDeclaration
|
, lookupDeclaration
|
||||||
, lookupMembers
|
, lookupMembers
|
||||||
, EdgeLabel(..)
|
, EdgeLabel(..)
|
||||||
|
, TestEvaluatingResult
|
||||||
, evaluateProject
|
, evaluateProject
|
||||||
) where
|
) where
|
||||||
|
|
||||||
@ -142,11 +143,14 @@ 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
|
||||||
|
= ( ScopeGraph Precise
|
||||||
|
, ( Heap Precise Precise (Value term Precise)
|
||||||
|
, Either (SomeError (Sum.Sum (TestEvaluatingErrors term))) a
|
||||||
|
)
|
||||||
|
)
|
||||||
testEvaluating :: Evaluator term Precise (Val term) (TestEvaluatingC term) a
|
testEvaluating :: Evaluator term Precise (Val term) (TestEvaluatingC term) a
|
||||||
-> IO
|
-> IO (TestEvaluatingResult term a)
|
||||||
(ScopeGraph Precise,
|
|
||||||
(Heap Precise Precise (Value term Precise),
|
|
||||||
Either (SomeError (Sum.Sum (TestEvaluatingErrors term))) a))
|
|
||||||
testEvaluating
|
testEvaluating
|
||||||
= runM
|
= runM
|
||||||
. runTraceByIgnoring
|
. runTraceByIgnoring
|
||||||
@ -166,7 +170,7 @@ testEvaluating
|
|||||||
|
|
||||||
type Val term = Value term Precise
|
type Val term = Value term Precise
|
||||||
|
|
||||||
evaluateProject :: (HasPrelude lang, SLanguage lang) => TaskSession -> Proxy lang -> [FilePath] -> IO (ScopeGraph Precise, (Heap Precise Precise (Value Any Precise), Either (SomeError (Sum.Sum (TestEvaluatingErrors Any))) (ModuleTable (Module (ModuleResult Precise (Value Any Precise))))))
|
evaluateProject :: (HasPrelude lang, SLanguage lang) => TaskSession -> Proxy lang -> [FilePath] -> IO (TestEvaluatingResult Any a)
|
||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user