summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2006-02-27 00:24:13 (GMT)
committerThomas Wouters <thomas@python.org>2006-02-27 00:24:13 (GMT)
commitdca3b9c797f6dd4b08d590fa2aa1031e22ab598e (patch)
treed2b7aa53793110100965906b1266296d08bd4ec1 /Python
parentd3a5f53a27be821cfdff869fd8ad93a060497e8c (diff)
downloadcpython-dca3b9c797f6dd4b08d590fa2aa1031e22ab598e.zip
cpython-dca3b9c797f6dd4b08d590fa2aa1031e22ab598e.tar.gz
cpython-dca3b9c797f6dd4b08d590fa2aa1031e22ab598e.tar.bz2
PEP 308 implementation, including minor refdocs and some testcases. It
breaks the parser module, because it adds the if/else construct as well as two new grammar rules for backward compatibility. If no one else fixes parsermodule, I guess I'll go ahead and fix it later this week. The TeX code was checked with texcheck.py, but not rendered. There is actually a slight incompatibility: >>> (x for x in lambda:0) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: iteration over non-sequence changes into >>> (x for x in lambda: 0) File "<stdin>", line 1 (x for x in lambda: 0) ^ SyntaxError: invalid syntax Since there's no way the former version can be useful, it's probably a bugfix ;)
Diffstat (limited to 'Python')
-rw-r--r--Python/Python-ast.c58
-rw-r--r--Python/ast.c40
-rw-r--r--Python/compile.c26
-rw-r--r--Python/graminit.c1096
-rw-r--r--Python/symtable.c5
5 files changed, 705 insertions, 520 deletions
diff --git a/Python/Python-ast.c b/Python/Python-ast.c
index 6935851..8d148e3 100644
--- a/Python/Python-ast.c
+++ b/Python/Python-ast.c
@@ -151,6 +151,12 @@ char *Lambda_fields[]={
"args",
"body",
};
+PyTypeObject *IfExp_type;
+char *IfExp_fields[]={
+ "test",
+ "body",
+ "orelse",
+};
PyTypeObject *Dict_type;
char *Dict_fields[]={
"keys",
@@ -431,6 +437,7 @@ static int init_types(void)
BinOp_type = make_type("BinOp", expr_type, BinOp_fields, 3);
UnaryOp_type = make_type("UnaryOp", expr_type, UnaryOp_fields, 2);
Lambda_type = make_type("Lambda", expr_type, Lambda_fields, 2);
+ IfExp_type = make_type("IfExp", expr_type, IfExp_fields, 3);
Dict_type = make_type("Dict", expr_type, Dict_fields, 2);
ListComp_type = make_type("ListComp", expr_type, ListComp_fields, 2);
GeneratorExp_type = make_type("GeneratorExp", expr_type,
@@ -1138,6 +1145,38 @@ Lambda(arguments_ty args, expr_ty body, int lineno, PyArena *arena)
}
expr_ty
+IfExp(expr_ty test, expr_ty body, expr_ty orelse, int lineno, PyArena *arena)
+{
+ expr_ty p;
+ if (!test) {
+ PyErr_SetString(PyExc_ValueError,
+ "field test is required for IfExp");
+ return NULL;
+ }
+ if (!body) {
+ PyErr_SetString(PyExc_ValueError,
+ "field body is required for IfExp");
+ return NULL;
+ }
+ if (!orelse) {
+ PyErr_SetString(PyExc_ValueError,
+ "field orelse is required for IfExp");
+ return NULL;
+ }
+ p = (expr_ty)PyArena_Malloc(arena, sizeof(*p));
+ if (!p) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ p->kind = IfExp_kind;
+ p->v.IfExp.test = test;
+ p->v.IfExp.body = body;
+ p->v.IfExp.orelse = orelse;
+ p->lineno = lineno;
+ return p;
+}
+
+expr_ty
Dict(asdl_seq * keys, asdl_seq * values, int lineno, PyArena *arena)
{
expr_ty p;
@@ -2077,6 +2116,25 @@ ast2obj_expr(void* _o)
goto failed;
Py_DECREF(value);
break;
+ case IfExp_kind:
+ result = PyType_GenericNew(IfExp_type, NULL, NULL);
+ if (!result) goto failed;
+ value = ast2obj_expr(o->v.IfExp.test);
+ if (!value) goto failed;
+ if (PyObject_SetAttrString(result, "test", value) == -1)
+ goto failed;
+ Py_DECREF(value);
+ value = ast2obj_expr(o->v.IfExp.body);
+ if (!value) goto failed;
+ if (PyObject_SetAttrString(result, "body", value) == -1)
+ goto failed;
+ Py_DECREF(value);
+ value = ast2obj_expr(o->v.IfExp.orelse);
+ if (!value) goto failed;
+ if (PyObject_SetAttrString(result, "orelse", value) == -1)
+ goto failed;
+ Py_DECREF(value);
+ break;
case Dict_kind:
result = PyType_GenericNew(Dict_type, NULL, NULL);
if (!result) goto failed;
diff --git a/Python/ast.c b/Python/ast.c
index 5d91344..94c877d 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -847,6 +847,25 @@ ast_for_lambdef(struct compiling *c, const node *n)
return Lambda(args, expression, LINENO(n), c->c_arena);
}
+static expr_ty
+ast_for_ifexpr(struct compiling *c, const node *n)
+{
+ /* test: or_test 'if' or_test 'else' test */
+ expr_ty expression, body, orelse;
+
+ assert(NCH(n) >= 3);
+ body = ast_for_expr(c, CHILD(n, 0));
+ if (!body)
+ return NULL;
+ expression = ast_for_expr(c, CHILD(n, 2));
+ if (!expression)
+ return NULL;
+ orelse = ast_for_expr(c, CHILD(n, 4));
+ if (!orelse)
+ return NULL;
+ return IfExp(expression, body, orelse, LINENO(n), c->c_arena);
+}
+
/* Count the number of 'for' loop in a list comprehension.
Helper for ast_for_listcomp().
@@ -1456,7 +1475,8 @@ static expr_ty
ast_for_expr(struct compiling *c, const node *n)
{
/* handle the full range of simple expressions
- test: and_test ('or' and_test)* | lambdef
+ test: or_test ['if' or_test 'else' test] | lambdef
+ or_test: and_test ('or' and_test)*
and_test: not_test ('and' not_test)*
not_test: 'not' not_test | comparison
comparison: expr (comp_op expr)*
@@ -1468,6 +1488,15 @@ ast_for_expr(struct compiling *c, const node *n)
term: factor (('*'|'/'|'%'|'//') factor)*
factor: ('+'|'-'|'~') factor | power
power: atom trailer* ('**' factor)*
+
+ As well as modified versions that exist for backward compatibility,
+ to explicitly allow:
+ [ x for x in lambda: 0, lambda: 1 ]
+ (which would be ambiguous without these extra rules)
+
+ old_test: or_test | old_lambdef
+ old_lambdef: 'lambda' [vararglist] ':' old_test
+
*/
asdl_seq *seq;
@@ -1476,9 +1505,14 @@ ast_for_expr(struct compiling *c, const node *n)
loop:
switch (TYPE(n)) {
case test:
- if (TYPE(CHILD(n, 0)) == lambdef)
+ case old_test:
+ if (TYPE(CHILD(n, 0)) == lambdef ||
+ TYPE(CHILD(n, 0)) == old_lambdef)
return ast_for_lambdef(c, CHILD(n, 0));
- /* Fall through to and_test */
+ else if (NCH(n) > 1)
+ return ast_for_ifexpr(c, n);
+ /* Fallthrough */
+ case or_test:
case and_test:
if (NCH(n) == 1) {
n = CHILD(n, 0);
diff --git a/Python/compile.c b/Python/compile.c
index e743168..0e8e50c 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -2010,6 +2010,30 @@ compiler_class(struct compiler *c, stmt_ty s)
}
static int
+compiler_ifexp(struct compiler *c, expr_ty e)
+{
+ basicblock *end, *next;
+
+ assert(e->kind == IfExp_kind);
+ end = compiler_new_block(c);
+ if (end == NULL)
+ return 0;
+ next = compiler_new_block(c);
+ if (next == NULL)
+ return 0;
+ VISIT(c, expr, e->v.IfExp.test);
+ ADDOP_JREL(c, JUMP_IF_FALSE, next);
+ ADDOP(c, POP_TOP);
+ VISIT(c, expr, e->v.IfExp.body);
+ ADDOP_JREL(c, JUMP_FORWARD, end);
+ compiler_use_next_block(c, next);
+ ADDOP(c, POP_TOP);
+ VISIT(c, expr, e->v.IfExp.orelse);
+ compiler_use_next_block(c, end);
+ return 1;
+}
+
+static int
compiler_lambda(struct compiler *c, expr_ty e)
{
PyCodeObject *co;
@@ -3290,6 +3314,8 @@ compiler_visit_expr(struct compiler *c, expr_ty e)
break;
case Lambda_kind:
return compiler_lambda(c, e);
+ case IfExp_kind:
+ return compiler_ifexp(c, e);
case Dict_kind:
/* XXX get rid of arg? */
ADDOP_I(c, BUILD_MAP, 0);
diff --git a/Python/graminit.c b/Python/graminit.c
index 64fbc2e..faca879 100644
--- a/Python/graminit.c
+++ b/Python/graminit.c
@@ -924,669 +924,665 @@ static state states_41[5] = {
{1, arcs_41_3},
{2, arcs_41_4},
};
-static arc arcs_42_0[2] = {
- {100, 1},
- {102, 2},
+static arc arcs_42_0[1] = {
+ {101, 1},
};
static arc arcs_42_1[2] = {
- {101, 3},
+ {27, 2},
{0, 1},
};
static arc arcs_42_2[1] = {
- {0, 2},
+ {101, 3},
};
-static arc arcs_42_3[1] = {
- {100, 1},
+static arc arcs_42_3[2] = {
+ {27, 4},
+ {0, 3},
};
-static state states_42[4] = {
- {2, arcs_42_0},
+static arc arcs_42_4[2] = {
+ {101, 3},
+ {0, 4},
+};
+static state states_42[5] = {
+ {1, arcs_42_0},
{2, arcs_42_1},
{1, arcs_42_2},
- {1, arcs_42_3},
+ {2, arcs_42_3},
+ {2, arcs_42_4},
};
-static arc arcs_43_0[1] = {
+static arc arcs_43_0[2] = {
+ {102, 1},
{103, 1},
};
-static arc arcs_43_1[2] = {
- {104, 0},
+static arc arcs_43_1[1] = {
{0, 1},
};
static state states_43[2] = {
- {1, arcs_43_0},
- {2, arcs_43_1},
+ {2, arcs_43_0},
+ {1, arcs_43_1},
};
-static arc arcs_44_0[2] = {
- {105, 1},
- {106, 2},
+static arc arcs_44_0[1] = {
+ {104, 1},
};
-static arc arcs_44_1[1] = {
- {103, 2},
+static arc arcs_44_1[2] = {
+ {23, 2},
+ {21, 3},
};
static arc arcs_44_2[1] = {
- {0, 2},
+ {21, 3},
+};
+static arc arcs_44_3[1] = {
+ {101, 4},
};
-static state states_44[3] = {
- {2, arcs_44_0},
- {1, arcs_44_1},
+static arc arcs_44_4[1] = {
+ {0, 4},
+};
+static state states_44[5] = {
+ {1, arcs_44_0},
+ {2, arcs_44_1},
{1, arcs_44_2},
+ {1, arcs_44_3},
+ {1, arcs_44_4},
};
-static arc arcs_45_0[1] = {
- {81, 1},
+static arc arcs_45_0[2] = {
+ {102, 1},
+ {105, 2},
};
static arc arcs_45_1[2] = {
- {107, 0},
+ {89, 3},
{0, 1},
};
-static state states_45[2] = {
- {1, arcs_45_0},
- {2, arcs_45_1},
+static arc arcs_45_2[1] = {
+ {0, 2},
};
-static arc arcs_46_0[10] = {
- {108, 1},
- {109, 1},
- {110, 1},
- {111, 1},
- {112, 1},
- {113, 1},
- {114, 1},
- {82, 1},
- {105, 2},
- {115, 3},
+static arc arcs_45_3[1] = {
+ {102, 4},
};
-static arc arcs_46_1[1] = {
- {0, 1},
+static arc arcs_45_4[1] = {
+ {91, 5},
};
-static arc arcs_46_2[1] = {
- {82, 1},
+static arc arcs_45_5[1] = {
+ {26, 2},
};
-static arc arcs_46_3[2] = {
- {105, 1},
- {0, 3},
+static state states_45[6] = {
+ {2, arcs_45_0},
+ {2, arcs_45_1},
+ {1, arcs_45_2},
+ {1, arcs_45_3},
+ {1, arcs_45_4},
+ {1, arcs_45_5},
};
-static state states_46[4] = {
- {10, arcs_46_0},
- {1, arcs_46_1},
- {1, arcs_46_2},
- {2, arcs_46_3},
+static arc arcs_46_0[1] = {
+ {106, 1},
+};
+static arc arcs_46_1[2] = {
+ {107, 0},
+ {0, 1},
+};
+static state states_46[2] = {
+ {1, arcs_46_0},
+ {2, arcs_46_1},
};
static arc arcs_47_0[1] = {
- {116, 1},
+ {108, 1},
};
static arc arcs_47_1[2] = {
- {117, 0},
+ {109, 0},
{0, 1},
};
static state states_47[2] = {
{1, arcs_47_0},
{2, arcs_47_1},
};
-static arc arcs_48_0[1] = {
- {118, 1},
+static arc arcs_48_0[2] = {
+ {110, 1},
+ {111, 2},
};
-static arc arcs_48_1[2] = {
- {119, 0},
- {0, 1},
+static arc arcs_48_1[1] = {
+ {108, 2},
+};
+static arc arcs_48_2[1] = {
+ {0, 2},
};
-static state states_48[2] = {
- {1, arcs_48_0},
- {2, arcs_48_1},
+static state states_48[3] = {
+ {2, arcs_48_0},
+ {1, arcs_48_1},
+ {1, arcs_48_2},
};
static arc arcs_49_0[1] = {
- {120, 1},
+ {81, 1},
};
static arc arcs_49_1[2] = {
- {121, 0},
+ {112, 0},
{0, 1},
};
static state states_49[2] = {
{1, arcs_49_0},
{2, arcs_49_1},
};
-static arc arcs_50_0[1] = {
- {122, 1},
+static arc arcs_50_0[10] = {
+ {113, 1},
+ {114, 1},
+ {115, 1},
+ {116, 1},
+ {117, 1},
+ {118, 1},
+ {119, 1},
+ {82, 1},
+ {110, 2},
+ {120, 3},
};
-static arc arcs_50_1[3] = {
- {123, 0},
- {57, 0},
+static arc arcs_50_1[1] = {
{0, 1},
};
-static state states_50[2] = {
- {1, arcs_50_0},
- {3, arcs_50_1},
+static arc arcs_50_2[1] = {
+ {82, 1},
+};
+static arc arcs_50_3[2] = {
+ {110, 1},
+ {0, 3},
+};
+static state states_50[4] = {
+ {10, arcs_50_0},
+ {1, arcs_50_1},
+ {1, arcs_50_2},
+ {2, arcs_50_3},
};
static arc arcs_51_0[1] = {
- {124, 1},
+ {121, 1},
};
-static arc arcs_51_1[3] = {
- {125, 0},
- {126, 0},
+static arc arcs_51_1[2] = {
+ {122, 0},
{0, 1},
};
static state states_51[2] = {
{1, arcs_51_0},
- {3, arcs_51_1},
+ {2, arcs_51_1},
};
static arc arcs_52_0[1] = {
- {127, 1},
+ {123, 1},
};
-static arc arcs_52_1[5] = {
- {28, 0},
- {128, 0},
- {129, 0},
- {130, 0},
+static arc arcs_52_1[2] = {
+ {124, 0},
{0, 1},
};
static state states_52[2] = {
{1, arcs_52_0},
- {5, arcs_52_1},
+ {2, arcs_52_1},
};
-static arc arcs_53_0[4] = {
+static arc arcs_53_0[1] = {
{125, 1},
- {126, 1},
+};
+static arc arcs_53_1[2] = {
+ {126, 0},
+ {0, 1},
+};
+static state states_53[2] = {
+ {1, arcs_53_0},
+ {2, arcs_53_1},
+};
+static arc arcs_54_0[1] = {
+ {127, 1},
+};
+static arc arcs_54_1[3] = {
+ {128, 0},
+ {57, 0},
+ {0, 1},
+};
+static state states_54[2] = {
+ {1, arcs_54_0},
+ {3, arcs_54_1},
+};
+static arc arcs_55_0[1] = {
+ {129, 1},
+};
+static arc arcs_55_1[3] = {
+ {130, 0},
+ {131, 0},
+ {0, 1},
+};
+static state states_55[2] = {
+ {1, arcs_55_0},
+ {3, arcs_55_1},
+};
+static arc arcs_56_0[1] = {
+ {132, 1},
+};
+static arc arcs_56_1[5] = {
+ {28, 0},
+ {133, 0},
+ {134, 0},
+ {135, 0},
+ {0, 1},
+};
+static state states_56[2] = {
+ {1, arcs_56_0},
+ {5, arcs_56_1},
+};
+static arc arcs_57_0[4] = {
+ {130, 1},
{131, 1},
- {132, 2},
+ {136, 1},
+ {137, 2},
};
-static arc arcs_53_1[1] = {
- {127, 2},
+static arc arcs_57_1[1] = {
+ {132, 2},
};
-static arc arcs_53_2[1] = {
+static arc arcs_57_2[1] = {
{0, 2},
};
-static state states_53[3] = {
- {4, arcs_53_0},
- {1, arcs_53_1},
- {1, arcs_53_2},
+static state states_57[3] = {
+ {4, arcs_57_0},
+ {1, arcs_57_1},
+ {1, arcs_57_2},
};
-static arc arcs_54_0[1] = {
- {133, 1},
+static arc arcs_58_0[1] = {
+ {138, 1},
};
-static arc arcs_54_1[3] = {
- {134, 1},
+static arc arcs_58_1[3] = {
+ {139, 1},
{29, 2},
{0, 1},
};
-static arc arcs_54_2[1] = {
- {127, 3},
+static arc arcs_58_2[1] = {
+ {132, 3},
};
-static arc arcs_54_3[1] = {
+static arc arcs_58_3[1] = {
{0, 3},
};
-static state states_54[4] = {
- {1, arcs_54_0},
- {3, arcs_54_1},
- {1, arcs_54_2},
- {1, arcs_54_3},
+static state states_58[4] = {
+ {1, arcs_58_0},
+ {3, arcs_58_1},
+ {1, arcs_58_2},
+ {1, arcs_58_3},
};
-static arc arcs_55_0[7] = {
+static arc arcs_59_0[7] = {
{13, 1},
- {136, 2},
- {139, 3},
- {142, 4},
+ {141, 2},
+ {144, 3},
+ {147, 4},
{19, 5},
- {144, 5},
- {145, 6},
+ {149, 5},
+ {150, 6},
};
-static arc arcs_55_1[3] = {
+static arc arcs_59_1[3] = {
{43, 7},
- {135, 7},
+ {140, 7},
{15, 5},
};
-static arc arcs_55_2[2] = {
- {137, 8},
- {138, 5},
+static arc arcs_59_2[2] = {
+ {142, 8},
+ {143, 5},
};
-static arc arcs_55_3[2] = {
- {140, 9},
- {141, 5},
+static arc arcs_59_3[2] = {
+ {145, 9},
+ {146, 5},
};
-static arc arcs_55_4[1] = {
- {143, 10},
+static arc arcs_59_4[1] = {
+ {148, 10},
};
-static arc arcs_55_5[1] = {
+static arc arcs_59_5[1] = {
{0, 5},
};
-static arc arcs_55_6[2] = {
- {145, 6},
+static arc arcs_59_6[2] = {
+ {150, 6},
{0, 6},
};
-static arc arcs_55_7[1] = {
+static arc arcs_59_7[1] = {
{15, 5},
};
-static arc arcs_55_8[1] = {
- {138, 5},
+static arc arcs_59_8[1] = {
+ {143, 5},
};
-static arc arcs_55_9[1] = {
- {141, 5},
+static arc arcs_59_9[1] = {
+ {146, 5},
};
-static arc arcs_55_10[1] = {
- {142, 5},
+static arc arcs_59_10[1] = {
+ {147, 5},
};
-static state states_55[11] = {
- {7, arcs_55_0},
- {3, arcs_55_1},
- {2, arcs_55_2},
- {2, arcs_55_3},
- {1, arcs_55_4},
- {1, arcs_55_5},
- {2, arcs_55_6},
- {1, arcs_55_7},
- {1, arcs_55_8},
- {1, arcs_55_9},
- {1, arcs_55_10},
+static state states_59[11] = {
+ {7, arcs_59_0},
+ {3, arcs_59_1},
+ {2, arcs_59_2},
+ {2, arcs_59_3},
+ {1, arcs_59_4},
+ {1, arcs_59_5},
+ {2, arcs_59_6},
+ {1, arcs_59_7},
+ {1, arcs_59_8},
+ {1, arcs_59_9},
+ {1, arcs_59_10},
};
-static arc arcs_56_0[1] = {
+static arc arcs_60_0[1] = {
{26, 1},
};
-static arc arcs_56_1[3] = {
- {146, 2},
+static arc arcs_60_1[3] = {
+ {151, 2},
{27, 3},
{0, 1},
};
-static arc arcs_56_2[1] = {
+static arc arcs_60_2[1] = {
{0, 2},
};
-static arc arcs_56_3[2] = {
+static arc arcs_60_3[2] = {
{26, 4},
{0, 3},
};
-static arc arcs_56_4[2] = {
+static arc arcs_60_4[2] = {
{27, 3},
{0, 4},
};
-static state states_56[5] = {
- {1, arcs_56_0},
- {3, arcs_56_1},
- {1, arcs_56_2},
- {2, arcs_56_3},
- {2, arcs_56_4},
+static state states_60[5] = {
+ {1, arcs_60_0},
+ {3, arcs_60_1},
+ {1, arcs_60_2},
+ {2, arcs_60_3},
+ {2, arcs_60_4},
};
-static arc arcs_57_0[1] = {
+static arc arcs_61_0[1] = {
{26, 1},
};
-static arc arcs_57_1[3] = {
- {147, 2},
+static arc arcs_61_1[3] = {
+ {152, 2},
{27, 3},
{0, 1},
};
-static arc arcs_57_2[1] = {
+static arc arcs_61_2[1] = {
{0, 2},
};
-static arc arcs_57_3[2] = {
+static arc arcs_61_3[2] = {
{26, 4},
{0, 3},
};
-static arc arcs_57_4[2] = {
+static arc arcs_61_4[2] = {
{27, 3},
{0, 4},
};
-static state states_57[5] = {
- {1, arcs_57_0},
- {3, arcs_57_1},
- {1, arcs_57_2},
- {2, arcs_57_3},
- {2, arcs_57_4},
+static state states_61[5] = {
+ {1, arcs_61_0},
+ {3, arcs_61_1},
+ {1, arcs_61_2},
+ {2, arcs_61_3},
+ {2, arcs_61_4},
};
-static arc arcs_58_0[1] = {
- {148, 1},
+static arc arcs_62_0[1] = {
+ {104, 1},
};
-static arc arcs_58_1[2] = {
+static arc arcs_62_1[2] = {
{23, 2},
{21, 3},
};
-static arc arcs_58_2[1] = {
+static arc arcs_62_2[1] = {
{21, 3},
};
-static arc arcs_58_3[1] = {
+static arc arcs_62_3[1] = {
{26, 4},
};
-static arc arcs_58_4[1] = {
+static arc arcs_62_4[1] = {
{0, 4},
};
-static state states_58[5] = {
- {1, arcs_58_0},
- {2, arcs_58_1},
- {1, arcs_58_2},
- {1, arcs_58_3},
- {1, arcs_58_4},
+static state states_62[5] = {
+ {1, arcs_62_0},
+ {2, arcs_62_1},
+ {1, arcs_62_2},
+ {1, arcs_62_3},
+ {1, arcs_62_4},
};
-static arc arcs_59_0[3] = {
+static arc arcs_63_0[3] = {
{13, 1},
- {136, 2},
+ {141, 2},
{75, 3},
};
-static arc arcs_59_1[2] = {
+static arc arcs_63_1[2] = {
{14, 4},
{15, 5},
};
-static arc arcs_59_2[1] = {
- {149, 6},
+static arc arcs_63_2[1] = {
+ {153, 6},
};
-static arc arcs_59_3[1] = {
+static arc arcs_63_3[1] = {
{19, 5},
};
-static arc arcs_59_4[1] = {
+static arc arcs_63_4[1] = {
{15, 5},
};
-static arc arcs_59_5[1] = {
+static arc arcs_63_5[1] = {
{0, 5},
};
-static arc arcs_59_6[1] = {
- {138, 5},
+static arc arcs_63_6[1] = {
+ {143, 5},
};
-static state states_59[7] = {
- {3, arcs_59_0},
- {2, arcs_59_1},
- {1, arcs_59_2},
- {1, arcs_59_3},
- {1, arcs_59_4},
- {1, arcs_59_5},
- {1, arcs_59_6},
+static state states_63[7] = {
+ {3, arcs_63_0},
+ {2, arcs_63_1},
+ {1, arcs_63_2},
+ {1, arcs_63_3},
+ {1, arcs_63_4},
+ {1, arcs_63_5},
+ {1, arcs_63_6},
};
-static arc arcs_60_0[1] = {
- {150, 1},
+static arc arcs_64_0[1] = {
+ {154, 1},
};
-static arc arcs_60_1[2] = {
+static arc arcs_64_1[2] = {
{27, 2},
{0, 1},
};
-static arc arcs_60_2[2] = {
- {150, 1},
+static arc arcs_64_2[2] = {
+ {154, 1},
{0, 2},
};
-static state states_60[3] = {
- {1, arcs_60_0},
- {2, arcs_60_1},
- {2, arcs_60_2},
+static state states_64[3] = {
+ {1, arcs_64_0},
+ {2, arcs_64_1},
+ {2, arcs_64_2},
};
-static arc arcs_61_0[3] = {
+static arc arcs_65_0[3] = {
{75, 1},
{26, 2},
{21, 3},
};
-static arc arcs_61_1[1] = {
+static arc arcs_65_1[1] = {
{75, 4},
};
-static arc arcs_61_2[2] = {
+static arc arcs_65_2[2] = {
{21, 3},
{0, 2},
};
-static arc arcs_61_3[3] = {
+static arc arcs_65_3[3] = {
{26, 5},
- {151, 6},
+ {155, 6},
{0, 3},
};
-static arc arcs_61_4[1] = {
+static arc arcs_65_4[1] = {
{75, 6},
};
-static arc arcs_61_5[2] = {
- {151, 6},
+static arc arcs_65_5[2] = {
+ {155, 6},
{0, 5},
};
-static arc arcs_61_6[1] = {
+static arc arcs_65_6[1] = {
{0, 6},
};
-static state states_61[7] = {
- {3, arcs_61_0},
- {1, arcs_61_1},
- {2, arcs_61_2},
- {3, arcs_61_3},
- {1, arcs_61_4},
- {2, arcs_61_5},
- {1, arcs_61_6},
+static state states_65[7] = {
+ {3, arcs_65_0},
+ {1, arcs_65_1},
+ {2, arcs_65_2},
+ {3, arcs_65_3},
+ {1, arcs_65_4},
+ {2, arcs_65_5},
+ {1, arcs_65_6},
};
-static arc arcs_62_0[1] = {
+static arc arcs_66_0[1] = {
{21, 1},
};
-static arc arcs_62_1[2] = {
+static arc arcs_66_1[2] = {
{26, 2},
{0, 1},
};
-static arc arcs_62_2[1] = {
+static arc arcs_66_2[1] = {
{0, 2},
};
-static state states_62[3] = {
- {1, arcs_62_0},
- {2, arcs_62_1},
- {1, arcs_62_2},
+static state states_66[3] = {
+ {1, arcs_66_0},
+ {2, arcs_66_1},
+ {1, arcs_66_2},
};
-static arc arcs_63_0[1] = {
+static arc arcs_67_0[1] = {
{81, 1},
};
-static arc arcs_63_1[2] = {
+static arc arcs_67_1[2] = {
{27, 2},
{0, 1},
};
-static arc arcs_63_2[2] = {
+static arc arcs_67_2[2] = {
{81, 1},
{0, 2},
};
-static state states_63[3] = {
- {1, arcs_63_0},
- {2, arcs_63_1},
- {2, arcs_63_2},
+static state states_67[3] = {
+ {1, arcs_67_0},
+ {2, arcs_67_1},
+ {2, arcs_67_2},
};
-static arc arcs_64_0[1] = {
+static arc arcs_68_0[1] = {
{26, 1},
};
-static arc arcs_64_1[2] = {
+static arc arcs_68_1[2] = {
{27, 2},
{0, 1},
};
-static arc arcs_64_2[2] = {
+static arc arcs_68_2[2] = {
{26, 1},
{0, 2},
};
-static state states_64[3] = {
- {1, arcs_64_0},
- {2, arcs_64_1},
- {2, arcs_64_2},
-};
-static arc arcs_65_0[1] = {
- {26, 1},
-};
-static arc arcs_65_1[2] = {
- {27, 2},
- {0, 1},
-};
-static arc arcs_65_2[1] = {
- {26, 3},
-};
-static arc arcs_65_3[2] = {
- {27, 4},
- {0, 3},
-};
-static arc arcs_65_4[2] = {
- {26, 3},
- {0, 4},
-};
-static state states_65[5] = {
- {1, arcs_65_0},
- {2, arcs_65_1},
- {1, arcs_65_2},
- {2, arcs_65_3},
- {2, arcs_65_4},
+static state states_68[3] = {
+ {1, arcs_68_0},
+ {2, arcs_68_1},
+ {2, arcs_68_2},
};
-static arc arcs_66_0[1] = {
+static arc arcs_69_0[1] = {
{26, 1},
};
-static arc arcs_66_1[1] = {
+static arc arcs_69_1[1] = {
{21, 2},
};
-static arc arcs_66_2[1] = {
+static arc arcs_69_2[1] = {
{26, 3},
};
-static arc arcs_66_3[2] = {
+static arc arcs_69_3[2] = {
{27, 4},
{0, 3},
};
-static arc arcs_66_4[2] = {
+static arc arcs_69_4[2] = {
{26, 1},
{0, 4},
};
-static state states_66[5] = {
- {1, arcs_66_0},
- {1, arcs_66_1},
- {1, arcs_66_2},
- {2, arcs_66_3},
- {2, arcs_66_4},
+static state states_69[5] = {
+ {1, arcs_69_0},
+ {1, arcs_69_1},
+ {1, arcs_69_2},
+ {2, arcs_69_3},
+ {2, arcs_69_4},
};
-static arc arcs_67_0[1] = {
- {153, 1},
+static arc arcs_70_0[1] = {
+ {156, 1},
};
-static arc arcs_67_1[1] = {
+static arc arcs_70_1[1] = {
{19, 2},
};
-static arc arcs_67_2[2] = {
+static arc arcs_70_2[2] = {
{13, 3},
{21, 4},
};
-static arc arcs_67_3[2] = {
+static arc arcs_70_3[2] = {
{9, 5},
{15, 6},
};
-static arc arcs_67_4[1] = {
+static arc arcs_70_4[1] = {
{22, 7},
};
-static arc arcs_67_5[1] = {
+static arc arcs_70_5[1] = {
{15, 6},
};
-static arc arcs_67_6[1] = {
+static arc arcs_70_6[1] = {
{21, 4},
};
-static arc arcs_67_7[1] = {
+static arc arcs_70_7[1] = {
{0, 7},
};
-static state states_67[8] = {
- {1, arcs_67_0},
- {1, arcs_67_1},
- {2, arcs_67_2},
- {2, arcs_67_3},
- {1, arcs_67_4},
- {1, arcs_67_5},
- {1, arcs_67_6},
- {1, arcs_67_7},
-};
-static arc arcs_68_0[3] = {
- {154, 1},
+static state states_70[8] = {
+ {1, arcs_70_0},
+ {1, arcs_70_1},
+ {2, arcs_70_2},
+ {2, arcs_70_3},
+ {1, arcs_70_4},
+ {1, arcs_70_5},
+ {1, arcs_70_6},
+ {1, arcs_70_7},
+};
+static arc arcs_71_0[3] = {
+ {157, 1},
{28, 2},
{29, 3},
};
-static arc arcs_68_1[2] = {
+static arc arcs_71_1[2] = {
{27, 4},
{0, 1},
};
-static arc arcs_68_2[1] = {
+static arc arcs_71_2[1] = {
{26, 5},
};
-static arc arcs_68_3[1] = {
+static arc arcs_71_3[1] = {
{26, 6},
};
-static arc arcs_68_4[4] = {
- {154, 1},
+static arc arcs_71_4[4] = {
+ {157, 1},
{28, 2},
{29, 3},
{0, 4},
};
-static arc arcs_68_5[2] = {
+static arc arcs_71_5[2] = {
{27, 7},
{0, 5},
};
-static arc arcs_68_6[1] = {
+static arc arcs_71_6[1] = {
{0, 6},
};
-static arc arcs_68_7[1] = {
+static arc arcs_71_7[1] = {
{29, 3},
};
-static state states_68[8] = {
- {3, arcs_68_0},
- {2, arcs_68_1},
- {1, arcs_68_2},
- {1, arcs_68_3},
- {4, arcs_68_4},
- {2, arcs_68_5},
- {1, arcs_68_6},
- {1, arcs_68_7},
-};
-static arc arcs_69_0[1] = {
- {26, 1},
-};
-static arc arcs_69_1[3] = {
- {147, 2},
- {25, 3},
- {0, 1},
-};
-static arc arcs_69_2[1] = {
- {0, 2},
-};
-static arc arcs_69_3[1] = {
- {26, 2},
-};
-static state states_69[4] = {
- {1, arcs_69_0},
- {3, arcs_69_1},
- {1, arcs_69_2},
- {1, arcs_69_3},
-};
-static arc arcs_70_0[2] = {
- {146, 1},
- {156, 1},
-};
-static arc arcs_70_1[1] = {
- {0, 1},
-};
-static state states_70[2] = {
- {2, arcs_70_0},
- {1, arcs_70_1},
-};
-static arc arcs_71_0[1] = {
- {93, 1},
-};
-static arc arcs_71_1[1] = {
- {59, 2},
-};
-static arc arcs_71_2[1] = {
- {82, 3},
-};
-static arc arcs_71_3[1] = {
- {152, 4},
-};
-static arc arcs_71_4[2] = {
- {155, 5},
- {0, 4},
-};
-static arc arcs_71_5[1] = {
- {0, 5},
-};
-static state states_71[6] = {
- {1, arcs_71_0},
- {1, arcs_71_1},
+static state states_71[8] = {
+ {3, arcs_71_0},
+ {2, arcs_71_1},
{1, arcs_71_2},
{1, arcs_71_3},
- {2, arcs_71_4},
- {1, arcs_71_5},
+ {4, arcs_71_4},
+ {2, arcs_71_5},
+ {1, arcs_71_6},
+ {1, arcs_71_7},
};
static arc arcs_72_0[1] = {
- {89, 1},
+ {26, 1},
};
-static arc arcs_72_1[1] = {
- {26, 2},
+static arc arcs_72_1[3] = {
+ {152, 2},
+ {25, 3},
+ {0, 1},
};
-static arc arcs_72_2[2] = {
- {155, 3},
+static arc arcs_72_2[1] = {
{0, 2},
};
static arc arcs_72_3[1] = {
- {0, 3},
+ {26, 2},
};
static state states_72[4] = {
{1, arcs_72_0},
- {1, arcs_72_1},
- {2, arcs_72_2},
+ {3, arcs_72_1},
+ {1, arcs_72_2},
{1, arcs_72_3},
};
static arc arcs_73_0[2] = {
- {147, 1},
- {158, 1},
+ {151, 1},
+ {159, 1},
};
static arc arcs_73_1[1] = {
{0, 1},
@@ -1605,10 +1601,10 @@ static arc arcs_74_2[1] = {
{82, 3},
};
static arc arcs_74_3[1] = {
- {26, 4},
+ {100, 4},
};
static arc arcs_74_4[2] = {
- {157, 5},
+ {158, 5},
{0, 4},
};
static arc arcs_74_5[1] = {
@@ -1629,7 +1625,7 @@ static arc arcs_75_1[1] = {
{26, 2},
};
static arc arcs_75_2[2] = {
- {157, 3},
+ {158, 3},
{0, 2},
};
static arc arcs_75_3[1] = {
@@ -1641,49 +1637,106 @@ static state states_75[4] = {
{2, arcs_75_2},
{1, arcs_75_3},
};
-static arc arcs_76_0[1] = {
- {26, 1},
+static arc arcs_76_0[2] = {
+ {152, 1},
+ {161, 1},
};
-static arc arcs_76_1[2] = {
- {27, 0},
+static arc arcs_76_1[1] = {
{0, 1},
};
static state states_76[2] = {
- {1, arcs_76_0},
- {2, arcs_76_1},
+ {2, arcs_76_0},
+ {1, arcs_76_1},
};
static arc arcs_77_0[1] = {
- {19, 1},
+ {93, 1},
};
static arc arcs_77_1[1] = {
- {0, 1},
+ {59, 2},
+};
+static arc arcs_77_2[1] = {
+ {82, 3},
+};
+static arc arcs_77_3[1] = {
+ {102, 4},
+};
+static arc arcs_77_4[2] = {
+ {160, 5},
+ {0, 4},
};
-static state states_77[2] = {
+static arc arcs_77_5[1] = {
+ {0, 5},
+};
+static state states_77[6] = {
{1, arcs_77_0},
{1, arcs_77_1},
+ {1, arcs_77_2},
+ {1, arcs_77_3},
+ {2, arcs_77_4},
+ {1, arcs_77_5},
};
static arc arcs_78_0[1] = {
- {160, 1},
+ {89, 1},
+};
+static arc arcs_78_1[1] = {
+ {26, 2},
+};
+static arc arcs_78_2[2] = {
+ {160, 3},
+ {0, 2},
+};
+static arc arcs_78_3[1] = {
+ {0, 3},
+};
+static state states_78[4] = {
+ {1, arcs_78_0},
+ {1, arcs_78_1},
+ {2, arcs_78_2},
+ {1, arcs_78_3},
+};
+static arc arcs_79_0[1] = {
+ {26, 1},
+};
+static arc arcs_79_1[2] = {
+ {27, 0},
+ {0, 1},
+};
+static state states_79[2] = {
+ {1, arcs_79_0},
+ {2, arcs_79_1},
+};
+static arc arcs_80_0[1] = {
+ {19, 1},
+};
+static arc arcs_80_1[1] = {
+ {0, 1},
+};
+static state states_80[2] = {
+ {1, arcs_80_0},
+ {1, arcs_80_1},
};
-static arc arcs_78_1[2] = {
+static arc arcs_81_0[1] = {
+ {163, 1},
+};
+static arc arcs_81_1[2] = {
{9, 2},
{0, 1},
};
-static arc arcs_78_2[1] = {
+static arc arcs_81_2[1] = {
{0, 2},
};
-static state states_78[3] = {
- {1, arcs_78_0},
- {2, arcs_78_1},
- {1, arcs_78_2},
+static state states_81[3] = {
+ {1, arcs_81_0},
+ {2, arcs_81_1},
+ {1, arcs_81_2},
};
-static dfa dfas[79] = {
+static dfa dfas[82] = {
{256, "single_input", 0, 3, states_0,
- "\004\050\014\000\000\000\000\025\074\205\011\162\000\002\000\140\010\111\023\002\001"},
+ "\004\050\014\000\000\000\000\025\074\205\011\162\000\101\000\000\014\041\151\020\010"},
{257, "file_input", 0, 2, states_1,
- "\204\050\014\000\000\000\000\025\074\205\011\162\000\002\000\140\010\111\023\002\001"},
+ "\204\050\014\000\000\000\000\025\074\205\011\162\000\101\000\000\014\041\151\020\010"},
{258, "eval_input", 0, 3, states_2,
- "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"},
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\101\000\000\014\041\151\000\000"},
{259, "decorator", 0, 7, states_3,
"\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
{260, "decorators", 0, 2, states_4,
@@ -1699,13 +1752,13 @@ static dfa dfas[79] = {
{265, "fplist", 0, 3, states_9,
"\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
{266, "stmt", 0, 2, states_10,
- "\000\050\014\000\000\000\000\025\074\205\011\162\000\002\000\140\010\111\023\002\001"},
+ "\000\050\014\000\000\000\000\025\074\205\011\162\000\101\000\000\014\041\151\020\010"},
{267, "simple_stmt", 0, 4, states_11,
- "\000\040\010\000\000\000\000\025\074\205\011\000\000\002\000\140\010\111\023\000\001"},
+ "\000\040\010\000\000\000\000\025\074\205\011\000\000\101\000\000\014\041\151\000\010"},
{268, "small_stmt", 0, 2, states_12,
- "\000\040\010\000\000\000\000\025\074\205\011\000\000\002\000\140\010\111\023\000\001"},
+ "\000\040\010\000\000\000\000\025\074\205\011\000\000\101\000\000\014\041\151\000\010"},
{269, "expr_stmt", 0, 6, states_13,
- "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"},
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\101\000\000\014\041\151\000\000"},
{270, "augassign", 0, 2, states_14,
"\000\000\000\000\000\360\377\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
{271, "print_stmt", 0, 9, states_15,
@@ -1715,7 +1768,7 @@ static dfa dfas[79] = {
{273, "pass_stmt", 0, 2, states_17,
"\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000\000\000"},
{274, "flow_stmt", 0, 2, states_18,
- "\000\000\000\000\000\000\000\000\074\000\000\000\000\000\000\000\000\000\000\000\001"},
+ "\000\000\000\000\000\000\000\000\074\000\000\000\000\000\000\000\000\000\000\000\010"},
{275, "break_stmt", 0, 2, states_19,
"\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000"},
{276, "continue_stmt", 0, 2, states_20,
@@ -1723,7 +1776,7 @@ static dfa dfas[79] = {
{277, "return_stmt", 0, 3, states_21,
"\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000\000"},
{278, "yield_stmt", 0, 2, states_22,
- "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001"},
+ "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\010"},
{279, "raise_stmt", 0, 7, states_23,
"\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000"},
{280, "import_stmt", 0, 2, states_24,
@@ -1749,7 +1802,7 @@ static dfa dfas[79] = {
{290, "assert_stmt", 0, 5, states_34,
"\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000"},
{291, "compound_stmt", 0, 2, states_35,
- "\000\010\004\000\000\000\000\000\000\000\000\162\000\000\000\000\000\000\000\002\000"},
+ "\000\010\004\000\000\000\000\000\000\000\000\162\000\000\000\000\000\000\000\020\000"},
{292, "if_stmt", 0, 8, states_36,
"\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000"},
{293, "while_stmt", 0, 8, states_37,
@@ -1761,83 +1814,89 @@ static dfa dfas[79] = {
{296, "except_clause", 0, 5, states_40,
"\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000"},
{297, "suite", 0, 5, states_41,
- "\004\040\010\000\000\000\000\025\074\205\011\000\000\002\000\140\010\111\023\000\001"},
- {298, "test", 0, 4, states_42,
- "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"},
- {299, "and_test", 0, 2, states_43,
- "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\003\000\000"},
- {300, "not_test", 0, 3, states_44,
- "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\003\000\000"},
- {301, "comparison", 0, 2, states_45,
- "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\140\010\111\003\000\000"},
- {302, "comp_op", 0, 4, states_46,
- "\000\000\000\000\000\000\000\000\000\000\004\000\000\362\017\000\000\000\000\000\000"},
- {303, "expr", 0, 2, states_47,
- "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\140\010\111\003\000\000"},
- {304, "xor_expr", 0, 2, states_48,
- "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\140\010\111\003\000\000"},
- {305, "and_expr", 0, 2, states_49,
- "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\140\010\111\003\000\000"},
- {306, "shift_expr", 0, 2, states_50,
- "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\140\010\111\003\000\000"},
- {307, "arith_expr", 0, 2, states_51,
- "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\140\010\111\003\000\000"},
- {308, "term", 0, 2, states_52,
- "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\140\010\111\003\000\000"},
- {309, "factor", 0, 3, states_53,
- "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\140\010\111\003\000\000"},
- {310, "power", 0, 4, states_54,
- "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\111\003\000\000"},
- {311, "atom", 0, 11, states_55,
- "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\111\003\000\000"},
- {312, "listmaker", 0, 5, states_56,
- "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"},
- {313, "testlist_gexp", 0, 5, states_57,
- "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"},
- {314, "lambdef", 0, 5, states_58,
- "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\020\000\000"},
- {315, "trailer", 0, 7, states_59,
- "\000\040\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\001\000\000\000"},
- {316, "subscriptlist", 0, 3, states_60,
- "\000\040\050\000\000\000\000\000\000\010\000\000\000\002\000\140\010\111\023\000\000"},
- {317, "subscript", 0, 7, states_61,
- "\000\040\050\000\000\000\000\000\000\010\000\000\000\002\000\140\010\111\023\000\000"},
- {318, "sliceop", 0, 3, states_62,
+ "\004\040\010\000\000\000\000\025\074\205\011\000\000\101\000\000\014\041\151\000\010"},
+ {298, "testlist_safe", 0, 5, states_42,
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\101\000\000\014\041\151\000\000"},
+ {299, "old_test", 0, 2, states_43,
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\101\000\000\014\041\151\000\000"},
+ {300, "old_lambdef", 0, 5, states_44,
+ "\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000"},
+ {301, "test", 0, 6, states_45,
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\101\000\000\014\041\151\000\000"},
+ {302, "or_test", 0, 2, states_46,
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\100\000\000\014\041\151\000\000"},
+ {303, "and_test", 0, 2, states_47,
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\100\000\000\014\041\151\000\000"},
+ {304, "not_test", 0, 3, states_48,
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\100\000\000\014\041\151\000\000"},
+ {305, "comparison", 0, 2, states_49,
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\014\041\151\000\000"},
+ {306, "comp_op", 0, 4, states_50,
+ "\000\000\000\000\000\000\000\000\000\000\004\000\000\100\376\001\000\000\000\000\000"},
+ {307, "expr", 0, 2, states_51,
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\014\041\151\000\000"},
+ {308, "xor_expr", 0, 2, states_52,
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\014\041\151\000\000"},
+ {309, "and_expr", 0, 2, states_53,
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\014\041\151\000\000"},
+ {310, "shift_expr", 0, 2, states_54,
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\014\041\151\000\000"},
+ {311, "arith_expr", 0, 2, states_55,
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\014\041\151\000\000"},
+ {312, "term", 0, 2, states_56,
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\014\041\151\000\000"},
+ {313, "factor", 0, 3, states_57,
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\014\041\151\000\000"},
+ {314, "power", 0, 4, states_58,
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\040\151\000\000"},
+ {315, "atom", 0, 11, states_59,
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\040\151\000\000"},
+ {316, "listmaker", 0, 5, states_60,
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\101\000\000\014\041\151\000\000"},
+ {317, "testlist_gexp", 0, 5, states_61,
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\101\000\000\014\041\151\000\000"},
+ {318, "lambdef", 0, 5, states_62,
+ "\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000"},
+ {319, "trailer", 0, 7, states_63,
+ "\000\040\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\040\000\000\000"},
+ {320, "subscriptlist", 0, 3, states_64,
+ "\000\040\050\000\000\000\000\000\000\010\000\000\000\101\000\000\014\041\151\000\000"},
+ {321, "subscript", 0, 7, states_65,
+ "\000\040\050\000\000\000\000\000\000\010\000\000\000\101\000\000\014\041\151\000\000"},
+ {322, "sliceop", 0, 3, states_66,
"\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
- {319, "exprlist", 0, 3, states_63,
- "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\140\010\111\003\000\000"},
- {320, "testlist", 0, 3, states_64,
- "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"},
- {321, "testlist_safe", 0, 5, states_65,
- "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"},
- {322, "dictmaker", 0, 5, states_66,
- "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"},
- {323, "classdef", 0, 8, states_67,
- "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000"},
- {324, "arglist", 0, 8, states_68,
- "\000\040\010\060\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"},
- {325, "argument", 0, 4, states_69,
- "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"},
- {326, "list_iter", 0, 2, states_70,
+ {323, "exprlist", 0, 3, states_67,
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\014\041\151\000\000"},
+ {324, "testlist", 0, 3, states_68,
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\101\000\000\014\041\151\000\000"},
+ {325, "dictmaker", 0, 5, states_69,
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\101\000\000\014\041\151\000\000"},
+ {326, "classdef", 0, 8, states_70,
+ "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\020\000"},
+ {327, "arglist", 0, 8, states_71,
+ "\000\040\010\060\000\000\000\000\000\000\000\000\000\101\000\000\014\041\151\000\000"},
+ {328, "argument", 0, 4, states_72,
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\101\000\000\014\041\151\000\000"},
+ {329, "list_iter", 0, 2, states_73,
"\000\000\000\000\000\000\000\000\000\000\000\042\000\000\000\000\000\000\000\000\000"},
- {327, "list_for", 0, 6, states_71,
+ {330, "list_for", 0, 6, states_74,
"\000\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000"},
- {328, "list_if", 0, 4, states_72,
+ {331, "list_if", 0, 4, states_75,
"\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000"},
- {329, "gen_iter", 0, 2, states_73,
+ {332, "gen_iter", 0, 2, states_76,
"\000\000\000\000\000\000\000\000\000\000\000\042\000\000\000\000\000\000\000\000\000"},
- {330, "gen_for", 0, 6, states_74,
+ {333, "gen_for", 0, 6, states_77,
"\000\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000"},
- {331, "gen_if", 0, 4, states_75,
+ {334, "gen_if", 0, 4, states_78,
"\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000"},
- {332, "testlist1", 0, 2, states_76,
- "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"},
- {333, "encoding_decl", 0, 2, states_77,
+ {335, "testlist1", 0, 2, states_79,
+ "\000\040\010\000\000\000\000\000\000\000\000\000\000\101\000\000\014\041\151\000\000"},
+ {336, "encoding_decl", 0, 2, states_80,
"\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
- {334, "yield_expr", 0, 3, states_78,
- "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001"},
+ {337, "yield_expr", 0, 3, states_81,
+ "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\010"},
};
-static label labels[161] = {
+static label labels[164] = {
{0, "EMPTY"},
{256, 0},
{4, 0},
@@ -1847,12 +1906,12 @@ static label labels[161] = {
{266, 0},
{0, 0},
{258, 0},
- {320, 0},
+ {324, 0},
{259, 0},
{50, 0},
{287, 0},
{7, 0},
- {324, 0},
+ {327, 0},
{8, 0},
{260, 0},
{261, 0},
@@ -1864,7 +1923,7 @@ static label labels[161] = {
{263, 0},
{264, 0},
{22, 0},
- {298, 0},
+ {301, 0},
{12, 0},
{16, 0},
{36, 0},
@@ -1881,7 +1940,7 @@ static label labels[161] = {
{289, 0},
{290, 0},
{270, 0},
- {334, 0},
+ {337, 0},
{37, 0},
{38, 0},
{39, 0},
@@ -1897,7 +1956,7 @@ static label labels[161] = {
{1, "print"},
{35, 0},
{1, "del"},
- {319, 0},
+ {323, 0},
{1, "pass"},
{275, 0},
{276, 0},
@@ -1919,14 +1978,14 @@ static label labels[161] = {
{284, 0},
{1, "global"},
{1, "exec"},
- {303, 0},
+ {307, 0},
{1, "in"},
{1, "assert"},
{292, 0},
{293, 0},
{294, 0},
{295, 0},
- {323, 0},
+ {326, 0},
{1, "if"},
{1, "elif"},
{1, "else"},
@@ -1938,14 +1997,19 @@ static label labels[161] = {
{1, "except"},
{5, 0},
{6, 0},
+ {298, 0},
{299, 0},
- {1, "or"},
- {314, 0},
+ {302, 0},
{300, 0},
+ {1, "lambda"},
+ {318, 0},
+ {303, 0},
+ {1, "or"},
+ {304, 0},
{1, "and"},
{1, "not"},
- {301, 0},
- {302, 0},
+ {305, 0},
+ {306, 0},
{20, 0},
{21, 0},
{28, 0},
@@ -1954,55 +2018,53 @@ static label labels[161] = {
{29, 0},
{29, 0},
{1, "is"},
- {304, 0},
+ {308, 0},
{18, 0},
- {305, 0},
+ {309, 0},
{33, 0},
- {306, 0},
+ {310, 0},
{19, 0},
- {307, 0},
+ {311, 0},
{34, 0},
- {308, 0},
+ {312, 0},
{14, 0},
{15, 0},
- {309, 0},
+ {313, 0},
{17, 0},
{24, 0},
{48, 0},
{32, 0},
- {310, 0},
- {311, 0},
+ {314, 0},
{315, 0},
- {313, 0},
+ {319, 0},
+ {317, 0},
{9, 0},
- {312, 0},
+ {316, 0},
{10, 0},
{26, 0},
- {322, 0},
+ {325, 0},
{27, 0},
{25, 0},
- {332, 0},
+ {335, 0},
{2, 0},
{3, 0},
- {327, 0},
{330, 0},
- {1, "lambda"},
- {316, 0},
- {317, 0},
- {318, 0},
+ {333, 0},
+ {320, 0},
{321, 0},
+ {322, 0},
{1, "class"},
- {325, 0},
- {326, 0},
{328, 0},
{329, 0},
{331, 0},
- {333, 0},
+ {332, 0},
+ {334, 0},
+ {336, 0},
{1, "yield"},
};
grammar _PyParser_Grammar = {
- 79,
+ 82,
dfas,
- {161, labels},
+ {164, labels},
256
};
diff --git a/Python/symtable.c b/Python/symtable.c
index fd95bd5..b66abc9 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -1084,6 +1084,11 @@ symtable_visit_expr(struct symtable *st, expr_ty e)
return 0;
break;
}
+ case IfExp_kind:
+ VISIT(st, expr, e->v.IfExp.test);
+ VISIT(st, expr, e->v.IfExp.body);
+ VISIT(st, expr, e->v.IfExp.orelse);
+ break;
case Dict_kind:
VISIT_SEQ(st, expr, e->v.Dict.keys);
VISIT_SEQ(st, expr, e->v.Dict.values);