classification
Title: better col_offset for AST in statements like "for a,b in ..."
Type: Stage:
Components: Interpreter Core Versions: Python 2.7
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, fwierzbicki
Priority: normal Keywords: patch

Created on 2009-08-14 18:55 by fwierzbicki, last changed 2009-08-15 22:59 by benjamin.peterson. This issue is now closed.

Files
File name Uploaded Description Edit
ast.diff fwierzbicki, 2009-08-14 18:55 patch for ast.c
ast.diff fwierzbicki, 2009-08-14 20:00 Try #2 added test data to test_ast.py
Messages (3)
msg91566 - (view) Author: Frank Wierzbicki (fwierzbicki) * (Python committer) Date: 2009-08-14 18:55
For statements like:

for a,b in c:
   pass

The Tuple node "a,b" ends up with a col_offset of 0 (the position of the
"for"), but the col_offset should probably be 4 (the position of "a").
This is more consistent with other Tuple node col_offset results.
msg91568 - (view) Author: Frank Wierzbicki (fwierzbicki) * (Python committer) Date: 2009-08-14 20:00
Adding tests to test_ast.py for the three cases that exercise the "for
a,b" scenario.  Also fixed a small bug in the test code generator in
test_ast.py
msg91624 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-08-15 22:59
Thanks for the patch! Commited in r74464.
History
Date User Action Args
2009-08-15 22:59:48benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg91624

resolution: accepted
2009-08-14 20:00:31fwierzbickisetfiles: + ast.diff

messages: + msg91568
2009-08-14 18:55:46fwierzbickicreate