Message178483
Please see the attached patch that will resolve the issue. It also includes a test case in test_ast.py.
What the patch does is as follows:
- tok_state is extended by two fields, namely first_lineno
and multi_line_start
- first_lineno will be set by tok_get as soon as the beginning
of a STRING is detected and it will be set to the current line
tok->lineno.
- multi_line_start is the beginning of the first line of a string
- in parsetok we now distinguish between STRING nodes and other
nodes. in case of STRING nodes, we will use the values of the
above fields for determining the actual lineno and the col_offset,
otherwise tok->col_offset and tok->lineno will be used when
creating the token.
The included test case ensures that the col_offset and lineno of
multi line strings is calculated correctly. |
|
Date |
User |
Action |
Args |
2012-12-29 10:50:57 | carsten.klein@axn-software.de | set | recipients:
+ carsten.klein@axn-software.de |
2012-12-29 10:50:56 | carsten.klein@axn-software.de | set | messageid: <1356778256.96.0.831280645084.issue16806@psf.upfronthosting.co.za> |
2012-12-29 10:50:56 | carsten.klein@axn-software.de | link | issue16806 messages |
2012-12-29 10:50:56 | carsten.klein@axn-software.de | create | |
|