1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 15:35:14 +03:00
This commit is contained in:
Patrick Thomson 2018-03-07 19:47:23 -05:00
parent 0ac705b0f5
commit be2d90f029
6 changed files with 58 additions and 8 deletions

View File

@ -7,12 +7,17 @@ import Data.Monoid
pyEval :: FilePath -> Benchmarkable pyEval :: FilePath -> Benchmarkable
pyEval = whnfIO . evaluatePythonFile . ("bench/bench-fixtures/python/" <>) pyEval = whnfIO . evaluatePythonFile . ("bench/bench-fixtures/python/" <>)
rbEval :: FilePath -> Benchmarkable
rbEval = whnfIO . evaluateRubyFile . ("bench/bench-fixtures/ruby/" <>)
main :: IO () main :: IO ()
main = defaultMain [ main = defaultMain
bgroup "python" [ bench "assignment" $ pyEval "simple-assignment.py" [ bgroup "python" [ bench "assignment" $ pyEval "simple-assignment.py"
, bench "function def" $ pyEval "function-definition.py" , bench "function def" $ pyEval "function-definition.py"
, bench "if + function calls" $ pyEval "if-statement-functions.py" , bench "if + function calls" $ pyEval "if-statement-functions.py"
] ]
, bgroup "ruby" [ bench "assignment" $ rbEval "simple-assignment.rb"
, bench "function def" $ rbEval "function-definition.rb"
, bench "if + function calls" $ rbEval "if-statement-functions.rb"
]
] ]

View File

@ -4,11 +4,11 @@ def a():
def c(d): def c(d):
e e
def g(g, *h,): def g(g, *h):
i i
def h(i=j): def h(i=1):
i i
def i(j:str="default", **c): def i(j="default", **c):
j j

View File

@ -2,11 +2,11 @@ def foo(): return "bipp"
def bar(): return foo() def bar(): return foo()
def baz(): return baz() def baz(): return bar()
def why(): return "elle" def why(): return "elle"
if True: if True:
foo() baz()
else: else:
why() why()

View File

@ -0,0 +1,19 @@
def a()
"b"
end
def c(d)
"e"
end
def g(g_)
"i"
end
def h(i=1)
i
end
def i()
"j"
end

View File

@ -0,0 +1,21 @@
def foo()
"bipp"
end
def bar()
foo()
end
def baz()
bar()
end
def why()
return "elle"
end
if true
baz()
else
why()
end

View File

@ -0,0 +1,5 @@
foo = 2
bar = foo
dang = 3
song = dang
song