Closed Brollof closed 3 years ago
This works fine on my machine. Could you double check that the code you are running is identical to what is on Github? What I can also imagine is that there might be another module called parser
on your python path and this is somehow shadowing the parser module that comes with this repository.
I think the problem might be that there is a name collision with the std lib parser
module. Maybe you should consider renaming the module to something like math_parser
which resolves the name conflict and is also clearer on what the module actually does.
Running:
python compute.py '2*(3+4)'
produces error:import parser Traceback (most recent call last): File "compute.py", line 7, in <module> parser.TokenType.T_PLUS: operator.add, AttributeError: module 'parser' has no attribute 'TokenType'