mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
Define a convenience for evaluating Python with dead code and tracing analyses.
This commit is contained in:
parent
902f269847
commit
9fa05c9b61
@ -4,6 +4,7 @@ module Semantic.Util where
|
||||
|
||||
import Prologue
|
||||
import Analysis.Abstract.Caching
|
||||
import Analysis.Abstract.Dead
|
||||
import Analysis.Abstract.Evaluating
|
||||
import Analysis.Abstract.Tracing
|
||||
import Analysis.Declaration
|
||||
@ -49,6 +50,10 @@ typecheckPythonFile path = run . lower @(CachingAnalysis (Evaluating Python.Term
|
||||
|
||||
tracePythonFile path = run . lower @(TracingAnalysis [] (Evaluating Python.Term PythonValue (TracingEffects [] Python.Term PythonValue))) . evaluateTerm <$> (file path >>= runTask . parse pythonParser)
|
||||
|
||||
type PythonTracer = TracingAnalysis [] (Evaluating Python.Term PythonValue (State (Dead (Python.Term)) ': TracingEffects [] Python.Term PythonValue))
|
||||
|
||||
evaluateDeadTracePythonFile path = run . lower @(DeadCodeAnalysis PythonTracer) . evaluateDead <$> (file path >>= runTask . parse pythonParser)
|
||||
|
||||
evaluatePythonFile path = evaluate @PythonValue <$>
|
||||
(file path >>= runTask . parse pythonParser)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user