<br><br><div><span class="gmail_quote">On 5/2/07, <b class="gmail_sendername">Andrew Koenig</b> &lt;<a href="mailto:ark@acm.org">ark@acm.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Looking at PEP-3125, I see that one of the rejected alternatives is to allow<br>any unfinished expression to indicate a line continuation.<br><br>I would like to suggest a modification to that alternative that has worked<br>
successfully in another programming language, namely Stu Feldman&#39;s EFL.&nbsp;&nbsp;EFL<br>is a language intended for numerical programming; it compiles into Fortran<br>with the interesting property that the resulting Fortran code is intended to
<br>be human-readable and maintainable by people who do not happen to have<br>access to the EFL compiler.<br><br>Anyway, the (only) continuation rule in EFL is that if the last token in a<br>line is one that lexically cannot be the last token in a statement, then the
<br>next line is considered a continuation of the current line.<br><br>Python currently has a rule that if parentheses are unbalanced, a newline<br>does not end the statement.&nbsp;&nbsp;If we were to translate the EFL rule to Python,
<br>it would be something like this:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The whitespace that follows an operator or open bracket or<br>parenthesis<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;can include newline characters.<br><br>Note that if this suggestion were implemented, it would presumably be at a
<br>very low lexical level--even before the decision is made to turn a newline<br>followed by spaces into an INDENT or DEDENT token.&nbsp;&nbsp;I think that this<br>property solves the difficulty-of-parsing problem.&nbsp;&nbsp;Indeed, I think that
<br>this suggestion would be easier to implement than the current<br>unbalanced-parentheses rule.<br><br></blockquote></div><br>Would this change alter where errors are reported by the parser?&nbsp; Is my<br><br>x = x +&nbsp;&nbsp;&nbsp; # Oops.
<br>... some other code ...<br><br>going to have an error reported 15 lines below where the actual typo was made?<br><br>Jerry<br>