1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 00:42:33 +03:00

Select an abstract parser.

This commit is contained in:
Rob Rix 2019-10-23 11:48:01 -04:00
parent d5cc356a8a
commit 52b0d4c508
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -51,14 +51,16 @@ callGraphProject' session proxy path
callGraphProject proxy paths = withOptions defaultOptions $ \ config logger statter ->
callGraphProject' (TaskSession config "" False logger statter) proxy paths
evaluateProject proxy parser path = withOptions defaultOptions $ \ config logger statter ->
evaluateProject proxy path
| let lang = Language.reflect proxy
, Just (SomeParser parser) <- Map.lookup lang analysisParsers = withOptions defaultOptions $ \ config logger statter ->
fmap (const ()) . justEvaluating =<< evaluateProject' (TaskSession config "" False logger statter) proxy parser [Path.toString path]
pyEval :: Path.RelFile -> Benchmarkable
pyEval p = nfIO $ evaluateProject (Proxy @'Language.Python) pythonParser (Path.relDir "bench/bench-fixtures/python" </> p)
pyEval p = nfIO $ evaluateProject (Proxy @'Language.Python) (Path.relDir "bench/bench-fixtures/python" </> p)
rbEval :: Path.RelFile -> Benchmarkable
rbEval p = nfIO $ evaluateProject (Proxy @'Language.Ruby) rubyParser (Path.relDir "bench/bench-fixtures/ruby" </> p)
rbEval p = nfIO $ evaluateProject (Proxy @'Language.Ruby) (Path.relDir "bench/bench-fixtures/ruby" </> p)
pyCall :: Path.RelFile -> Benchmarkable
pyCall p = nfIO $ callGraphProject (Proxy @'Language.Python) (Path.relDir "bench/bench-fixtures/python/" </> p)