summaryrefslogtreecommitdiffstats
path: root/Include/Python-ast.h
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2007-04-15 12:05:43 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2007-04-15 12:05:43 (GMT)
commit650f0d06d3574f843f52edd1126ddd9ebd6fac7d (patch)
tree9116cebfb4031d0ac3b2db7dc0e8c85d82751e59 /Include/Python-ast.h
parent6ef6306dd62aa092539298ed69c7c6ffff568e2d (diff)
downloadcpython-650f0d06d3574f843f52edd1126ddd9ebd6fac7d.zip
cpython-650f0d06d3574f843f52edd1126ddd9ebd6fac7d.tar.gz
cpython-650f0d06d3574f843f52edd1126ddd9ebd6fac7d.tar.bz2
Hide list comp variables and support set comprehensions
Diffstat (limited to 'Include/Python-ast.h')
-rw-r--r--Include/Python-ast.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/Include/Python-ast.h b/Include/Python-ast.h
index e07f025..d88076b 100644
--- a/Include/Python-ast.h
+++ b/Include/Python-ast.h
@@ -183,10 +183,10 @@ struct _stmt {
enum _expr_kind {BoolOp_kind=1, BinOp_kind=2, UnaryOp_kind=3, Lambda_kind=4,
IfExp_kind=5, Dict_kind=6, Set_kind=7, ListComp_kind=8,
- GeneratorExp_kind=9, Yield_kind=10, Compare_kind=11,
- Call_kind=12, Num_kind=13, Str_kind=14, Bytes_kind=15,
- Ellipsis_kind=16, Attribute_kind=17, Subscript_kind=18,
- Name_kind=19, List_kind=20, Tuple_kind=21};
+ SetComp_kind=9, GeneratorExp_kind=10, Yield_kind=11,
+ Compare_kind=12, Call_kind=13, Num_kind=14, Str_kind=15,
+ Bytes_kind=16, Ellipsis_kind=17, Attribute_kind=18,
+ Subscript_kind=19, Name_kind=20, List_kind=21, Tuple_kind=22};
struct _expr {
enum _expr_kind kind;
union {
@@ -234,6 +234,11 @@ struct _expr {
struct {
expr_ty elt;
asdl_seq *generators;
+ } SetComp;
+
+ struct {
+ expr_ty elt;
+ asdl_seq *generators;
} GeneratorExp;
struct {
@@ -465,6 +470,9 @@ expr_ty _Py_Set(asdl_seq * elts, int lineno, int col_offset, PyArena *arena);
#define ListComp(a0, a1, a2, a3, a4) _Py_ListComp(a0, a1, a2, a3, a4)
expr_ty _Py_ListComp(expr_ty elt, asdl_seq * generators, int lineno, int
col_offset, PyArena *arena);
+#define SetComp(a0, a1, a2, a3, a4) _Py_SetComp(a0, a1, a2, a3, a4)
+expr_ty _Py_SetComp(expr_ty elt, asdl_seq * generators, int lineno, int
+ col_offset, PyArena *arena);
#define GeneratorExp(a0, a1, a2, a3, a4) _Py_GeneratorExp(a0, a1, a2, a3, a4)
expr_ty _Py_GeneratorExp(expr_ty elt, asdl_seq * generators, int lineno, int
col_offset, PyArena *arena);