Closed GoogleCodeExporter closed 9 years ago
As reported by Charlie:
I assumed that Pow was for exponentiation(i.e. ‘**’).
So I downloaded the source code and added the “Pow” operator to
“core_parser_ast.py” as follows:
BINOP_SYMBOLS = {
Add: '+',
Sub: '-',
Mult: '*',
Div: '/',
FloorDiv: '//',
Mod: '%',
LShift: '<<',
RShift: '>>',
BitOr: '|',
BitAnd: '&',
Pow: '**',
BitXor: '^'
}
The code seemed to work just fine after that (running from source and not the
Windows exe).
I’m sorry I cannot send you the python source that caused the problem, it is
my employer’s code.
As an aside… after sending you the first email, I got another error in
core_parser_ast.py. An assert statement caused the code to crash at line 364
(with my new added Pow).
I commented out the “assert” and had the code just print a warning (see
below). It seemed to solve my second problem as well.
#assert node.name in self.quick_parse.quick_found_module_defs
# cet change
if node.name not in self.quick_parse.quick_found_module_defs:
print 'ERROR... node.name=',node.name,'is not in quick_found_module_defs'
Charlie
Original comment by abu...@gmail.com
on 6 Sep 2012 at 6:37
Also reported by Marco
I recently installed your windows executable in a Windows XP machine, I tried
to graph simple python code and I got problems with the exponentiation
operator. Is that expected?
Thanks in advance.
--Marco
Original comment by abu...@gmail.com
on 6 Sep 2012 at 6:38
This issue was updated by revision r573.
Added unit test to catch power operator parsing problem.
Original comment by abu...@gmail.com
on 6 Sep 2012 at 6:39
This issue was closed by revision r574.
Original comment by abu...@gmail.com
on 6 Sep 2012 at 6:46
Original issue reported on code.google.com by
abu...@gmail.com
on 6 Sep 2012 at 6:35