align children of generator expressions (PY-8822)

This commit is contained in:
Dmitry Jemerov
2013-02-15 19:11:25 +01:00
parent ad6105d2f6
commit e8e2017723
4 changed files with 18 additions and 1 deletions
@@ -53,7 +53,8 @@ public class PyBlock implements ASTBlock {
PyElementTypes.TUPLE_EXPRESSION,
PyElementTypes.PARENTHESIZED_EXPRESSION,
PyElementTypes.SLICE_EXPRESSION,
PyElementTypes.SUBSCRIPTION_EXPRESSION);
PyElementTypes.SUBSCRIPTION_EXPRESSION,
PyElementTypes.GENERATOR_EXPRESSION);
private static final TokenSet ourBrackets = TokenSet.create(PyTokenTypes.LPAR, PyTokenTypes.RPAR,
PyTokenTypes.LBRACE, PyTokenTypes.RBRACE,
@@ -0,0 +1,6 @@
def supprice():
if True:
if True:
agdrn = sum(VARS[drn + price] * md.c[drn][1] * md.c[drn][3] *
exp(md.c[drn][2] * VARS['SEEPAGE'] - md.c[drn][3] * pmp)
for drn in md.agdrn_nodes if drn in md.c)
@@ -0,0 +1,6 @@
def supprice():
if True:
if True:
agdrn = sum(VARS[drn + price] * md.c[drn][1] * md.c[drn][3] *
exp(md.c[drn][2] * VARS['SEEPAGE'] - md.c[drn][3] * pmp)
for drn in md.agdrn_nodes if drn in md.c)
@@ -260,6 +260,10 @@ public class PyFormatterTest extends PyTestCase {
doTest();
}
public void testAlignInGenerators() { // PY-8822
doTest();
}
public void testContinuationIndentForCallInStatementPart() { // PY-8577
doTest();
}