On Sun, Feb 28, 2010 at 12:03 PM, Edward K. Ream <[email protected]> wrote:
> 3. Long lines. Discussed in the "Code Layout" section of pep 8. The
> recommendations are excellent.
This problem is *much* easier to solve using strings than using tokens
or parse trees. Indeed, we want to scan back from the end of the long
line, character by character, looking for an open delim: '(', '{' or
'['. If one is found at left of the 80th column we can split the line
there, indenting the continuation line. For extremely long lines, the
continuation line might also be too long. If so, we simple repeat the
process.
It's possible to imagine pathological lines containing no open delims.
In that case, we will have to find alternative places to split the
line and use '\' to continue lines.
EKR
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en.