Message216846
Regarding #16795, the documentation says "The lineno is the line number of source text and the col_offset is the UTF-8 byte offset of the first token that generated the node", not that lineno and col_offset indicate a suitable position to mention in the error messages related to this node.
IMO lineno and col_offset should stay as predictable means for finding the (beginning of) source text of the node. In error reporting code one could inspect the situation and compute locations suitable for this.
Alternatively, these attributes could be left for purposes mentioned in #16795 and parser developers could introduce new attributes in ast nodes which indicate both start and end positions of corresponding source. (Hopefully this would resolve also #18374 and #16806) |
|
Date |
User |
Action |
Args |
2014-04-19 06:14:02 | Aivar.Annamaa | set | recipients:
+ Aivar.Annamaa, brett.cannon, georg.brandl, ncoghlan, benjamin.peterson, flox |
2014-04-19 06:14:02 | Aivar.Annamaa | set | messageid: <1397888042.42.0.58492972513.issue21295@psf.upfronthosting.co.za> |
2014-04-19 06:14:02 | Aivar.Annamaa | link | issue21295 messages |
2014-04-19 06:14:01 | Aivar.Annamaa | create | |
|