Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
arpeggio-gm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
backend
arpeggio-gm
Commits
e76e6c8c
Commit
e76e6c8c
authored
Jul 27, 2014
by
Igor Dejanovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix in performance test
parent
dd0c4d2a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
test_speed.py
tests/speed/test_speed.py
+2
-2
No files found.
tests/speed/test_speed.py
View file @
e76e6c8c
...
@@ -12,14 +12,14 @@ import timeit, sys
...
@@ -12,14 +12,14 @@ import timeit, sys
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
setup
=
'''
setup
=
'''
from arpeggio import OneOrMore, ZeroOrMore, E
ndOfFile
, ParserPython, Optional
from arpeggio import OneOrMore, ZeroOrMore, E
OF
, ParserPython, Optional
from arpeggio import RegExMatch as _
from arpeggio import RegExMatch as _
def number(): return _(r'
\
d*
\
.
\
d*|
\
d+')
def number(): return _(r'
\
d*
\
.
\
d*|
\
d+')
def factor(): return [(Optional(["+","-"]), number), ("(", expression, ")")]
def factor(): return [(Optional(["+","-"]), number), ("(", expression, ")")]
def term(): return factor, ZeroOrMore(["*","/"], factor)
def term(): return factor, ZeroOrMore(["*","/"], factor)
def expression(): return term, ZeroOrMore(["+", "-"], term)
def expression(): return term, ZeroOrMore(["+", "-"], term)
def calcfile(): return OneOrMore(expression), E
ndOfFile
def calcfile(): return OneOrMore(expression), E
OF
parser = ParserPython(calcfile, reduce_tree=True)
parser = ParserPython(calcfile, reduce_tree=True)
with open("input.txt", "r") as f:
with open("input.txt", "r") as f:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment