Issue1168
Created on 2008-11-09.01:57:29 by certik, last changed 2009-03-02.20:38:33 by fwierzbicki.
File name |
Uploaded |
Description |
Edit |
Remove |
ast_test.py
|
certik,
2008-11-09.01:57:28
|
|
|
|
msg3765 (view) |
Author: Ondrej Certik (certik) |
Date: 2008-11-09.01:57:28 |
|
Attached find a pure python
script (with no external dependecies) that reproduces the problem.
python2.6:
$ python2.6 ast_test.py
<__main__.Integer object at 0xb7bcf96c>
<__main__.Div object at 0xb7bcfbac>
<__main__.Mul object at 0xb7bcfbec>
jython
$ jython ast_test.py
Traceback (most recent call last):
File "ast_test.py", line 79, in <module>
print parse_expr("1", {})
File "ast_test.py", line 75, in parse_expr
a = Transform(local_dict, global_dict).visit(a)
File "/home/ondra/repos/jython/dist/Lib/ast.py", line 256, in visit
return visitor(node)
File "/home/ondra/repos/jython/dist/Lib/ast.py", line 321, in generic_visit
new_node = self.visit(old_value)
File "/home/ondra/repos/jython/dist/Lib/ast.py", line 256, in visit
return visitor(node)
File "ast_test.py", line 36, in visit_Num
return fix_missing_locations(Call(Name('Integer', Load()),
TypeError: org.python.antlr.ast.Name(): expected 3-4 args; got 2
|
msg3770 (view) |
Author: Ondrej Certik (certik) |
Date: 2008-11-10.07:13:56 |
|
This now works. Thanks for the fix!
Now try to add this line at the end of the script:
print parse_expr("Integer(3)", {})
and run it:
$ python2.6 ast_test.py
<__main__.Integer object at 0xb7ba092c>
<__main__.Div object at 0xb7ba0b6c>
<__main__.Mul object at 0xb7ba0bac>
<__main__.Integer object at 0xb7ba0a6c>
$ jython ast_test.py
<__main__.Integer object at 1>
<__main__.Div object at 2>
<__main__.Mul object at 3>
Traceback (most recent call last):
File "ast_test.py", line 82, in <module>
print parse_expr("Integer(3)", {})
File "ast_test.py", line 75, in parse_expr
a = Transform(local_dict, global_dict).visit(a)
File "/home/ondra/repos/jython/dist/Lib/ast.py", line 256, in visit
return visitor(node)
File "/home/ondra/repos/jython/dist/Lib/ast.py", line 321, in
generic_visit
new_node = self.visit(old_value)
File "/home/ondra/repos/jython/dist/Lib/ast.py", line 256, in visit
return visitor(node)
File "/home/ondra/repos/jython/dist/Lib/ast.py", line 319, in
generic_visit
old_value[:] = new_values
TypeError: can only assign array (not "list") to array slice
And there will probably be couple more. I'll try to isolate it.
|
msg4167 (view) |
Author: Frank Wierzbicki (fwierzbicki) |
Date: 2009-03-02.20:38:33 |
|
The specific issues here are fixed now, so I'm closing this one.
|
|
Date |
User |
Action |
Args |
2009-03-02 20:38:33 | fwierzbicki | set | status: open -> closed resolution: fixed messages:
+ msg4167 |
2008-12-14 17:16:00 | fwierzbicki | set | components:
+ Core |
2008-11-10 21:43:45 | fwierzbicki | set | assignee: fwierzbicki nosy:
+ fwierzbicki |
2008-11-10 07:13:57 | certik | set | messages:
+ msg3770 |
2008-11-09 01:57:29 | certik | create | |
|