Skip to content

Commit 925f2b1

Browse files
authored
Merge pull request #3 from mikea-cmu/bugfix/noeval-parser
ADT Parser uses excesive memory on medium-large files
2 parents 9675bb9 + 95d5e56 commit 925f2b1

14 files changed

+991
-2
lines changed

.gitignore

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#### joe made this: http://goel.io/joe
2+
#### Python ####
3+
# Byte-compiled / optimized / DLL files
4+
__pycache__/
5+
*.py[cod]
6+
*$py.class
7+
8+
# C extensions
9+
*.so
10+
11+
# Distribution / packaging
12+
.Python
13+
env/
14+
build/
15+
develop-eggs/
16+
dist/
17+
downloads/
18+
eggs/
19+
.eggs/
20+
lib/
21+
lib64/
22+
parts/
23+
sdist/
24+
var/
25+
wheels/
26+
*.egg-info/
27+
.installed.cfg
28+
*.egg
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*,cover
49+
.hypothesis/
50+
51+
# Translations
52+
*.mo
53+
*.pot
54+
55+
# Django stuff:
56+
*.log
57+
local_settings.py
58+
59+
# Flask stuff:
60+
instance/
61+
.webassets-cache
62+
63+
# Scrapy stuff:
64+
.scrapy
65+
66+
# Sphinx documentation
67+
docs/_build/
68+
69+
# PyBuilder
70+
target/
71+
72+
# Jupyter Notebook
73+
.ipynb_checkpoints
74+
75+
# pyenv
76+
.python-version
77+
78+
# celery beat schedule file
79+
celerybeat-schedule
80+
81+
# dotenv
82+
.env
83+
84+
# virtualenv
85+
.venv/
86+
venv/
87+
ENV/
88+
89+
# Spyder project settings
90+
.spyderproject
91+
92+
# Rope project settings
93+
.ropeproject
94+

conftest.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'''pytest configuration module'''
2+
import pytest # pylint: disable=import-error
3+
4+
# configure setup to skip slow tests by default (without --slow flag)
5+
def pytest_runtest_setup(item):
6+
"""Skip tests if they are marked as slow and --slow is not given"""
7+
if getattr(item.obj, 'slow', None) and not item.config.getvalue('slow'):
8+
pytest.skip('slow tests not requested')
9+
10+
# add '--slow' flag to enable the slow tests, but default to False/disabled
11+
def pytest_addoption(parser):
12+
'''Add --slow option'''
13+
parser.addoption('--slow', action='store_true', default=False,
14+
help='Also run slow tests')
15+

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
maintainer = 'Ivan Gotovchits',
1212
maintainer_email = '[email protected]',
1313
license = 'MIT',
14-
package_dir = {'bap' : 'src'},
14+
package_dir = {'' : 'src'},
1515
packages = ['bap'],
1616
extras_require = {
1717
'rpc' : ['requests']
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/bir.py renamed to src/bap/bir.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from collections import Sequence,Mapping
66
from .adt import *
77
from .bil import *
8+
from . import noeval_parser
89

910

1011
class Project(ADT) :
@@ -363,4 +364,4 @@ def parse_addr(str):
363364

364365
def loads(s):
365366
"loads bir object from string"
366-
return eval(s)
367+
return noeval_parser.parser(s)

0 commit comments

Comments
 (0)