mirror of
https://github.com/github/semantic.git
synced 2024-12-19 12:51:52 +03:00
commit
d6cf05177e
@ -11,10 +11,10 @@ import Control.Monad
|
||||
-- project—coercing the result into a string will suffice, though it throws off the
|
||||
-- memory allocation results a bit.
|
||||
pyEval :: FilePath -> Benchmarkable
|
||||
pyEval = whnfIO . fmap show . evaluatePythonFile . ("bench/bench-fixtures/python/" <>)
|
||||
pyEval = whnfIO . fmap show . evalPythonProject . ("bench/bench-fixtures/python/" <>)
|
||||
|
||||
rbEval :: FilePath -> Benchmarkable
|
||||
rbEval = whnfIO . fmap show . evaluateRubyFile . ("bench/bench-fixtures/ruby/" <>)
|
||||
rbEval = whnfIO . fmap show . evalRubyProject . ("bench/bench-fixtures/ruby/" <>)
|
||||
|
||||
main :: IO ()
|
||||
main = defaultMain
|
||||
|
@ -80,10 +80,6 @@ pythonPrelude = Just $ File (TypeLevel.symbolVal (Proxy :: Proxy (PreludePath Py
|
||||
-- Evaluate a project, starting at a single entrypoint.
|
||||
evaluateProject parser lang prelude path = evaluatePackage <$> runTask (readProject Nothing path lang [] >>= parsePackage parser prelude)
|
||||
|
||||
evalRubyFile path = interpret @(JustEvaluating Ruby.Term) <$> evaluateFile rubyParser path
|
||||
evaluateFile parser path = evaluateModule <$> runTask (parseModule parser Nothing (file path))
|
||||
|
||||
|
||||
parseFile :: Parser term -> FilePath -> IO term
|
||||
parseFile parser = runTask . (parse parser <=< readBlob . file)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user