diff options
author | Guido van Rossum <guido@python.org> | 2006-08-28 15:27:34 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2006-08-28 15:27:34 (GMT) |
commit | 86e58e239e39845e706c4afa392423f0fedcdf39 (patch) | |
tree | 1d0f4d942e644ee5c903636d87176b98a7203371 /Include | |
parent | ecfd0b2f3bfd622c3ba148e53d3feebb8c1ae721 (diff) | |
download | cpython-86e58e239e39845e706c4afa392423f0fedcdf39.zip cpython-86e58e239e39845e706c4afa392423f0fedcdf39.tar.gz cpython-86e58e239e39845e706c4afa392423f0fedcdf39.tar.bz2 |
SF patch 1547796 by Georg Brandl -- set literals.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/Python-ast.h | 13 | ||||
-rw-r--r-- | Include/graminit.h | 2 | ||||
-rw-r--r-- | Include/opcode.h | 11 |
3 files changed, 16 insertions, 10 deletions
diff --git a/Include/Python-ast.h b/Include/Python-ast.h index 8fd8ceb..390b8ea 100644 --- a/Include/Python-ast.h +++ b/Include/Python-ast.h @@ -184,10 +184,10 @@ struct _stmt { }; enum _expr_kind {BoolOp_kind=1, BinOp_kind=2, UnaryOp_kind=3, Lambda_kind=4, - IfExp_kind=5, Dict_kind=6, ListComp_kind=7, - GeneratorExp_kind=8, Yield_kind=9, Compare_kind=10, - Call_kind=11, Num_kind=12, Str_kind=13, Attribute_kind=14, - Subscript_kind=15, Name_kind=16, List_kind=17, Tuple_kind=18}; + 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, Attribute_kind=15, + Subscript_kind=16, Name_kind=17, List_kind=18, Tuple_kind=19}; struct _expr { enum _expr_kind kind; union { @@ -224,6 +224,10 @@ struct _expr { } Dict; struct { + asdl_seq *elts; + } Set; + + struct { expr_ty elt; asdl_seq *generators; } ListComp; @@ -399,6 +403,7 @@ expr_ty IfExp(expr_ty test, expr_ty body, expr_ty orelse, int lineno, int col_offset, PyArena *arena); expr_ty Dict(asdl_seq * keys, asdl_seq * values, int lineno, int col_offset, PyArena *arena); +expr_ty Set(asdl_seq * elts, int lineno, int col_offset, PyArena *arena); expr_ty ListComp(expr_ty elt, asdl_seq * generators, int lineno, int col_offset, PyArena *arena); expr_ty GeneratorExp(expr_ty elt, asdl_seq * generators, int lineno, int diff --git a/Include/graminit.h b/Include/graminit.h index 9af182a..f4701a6 100644 --- a/Include/graminit.h +++ b/Include/graminit.h @@ -69,7 +69,7 @@ #define sliceop 324 #define exprlist 325 #define testlist 326 -#define dictmaker 327 +#define dictsetmaker 327 #define classdef 328 #define arglist 329 #define argument 330 diff --git a/Include/opcode.h b/Include/opcode.h index 1b9cb5c..4c823d9 100644 --- a/Include/opcode.h +++ b/Include/opcode.h @@ -97,11 +97,12 @@ extern "C" { #define LOAD_NAME 101 /* Index in name list */ #define BUILD_TUPLE 102 /* Number of tuple items */ #define BUILD_LIST 103 /* Number of list items */ -#define BUILD_MAP 104 /* Always zero for now */ -#define LOAD_ATTR 105 /* Index in name list */ -#define COMPARE_OP 106 /* Comparison operator */ -#define IMPORT_NAME 107 /* Index in name list */ -#define IMPORT_FROM 108 /* Index in name list */ +#define BUILD_SET 104 /* Number of set items */ +#define BUILD_MAP 105 /* Always zero for now */ +#define LOAD_ATTR 106 /* Index in name list */ +#define COMPARE_OP 107 /* Comparison operator */ +#define IMPORT_NAME 108 /* Index in name list */ +#define IMPORT_FROM 109 /* Index in name list */ #define JUMP_FORWARD 110 /* Number of bytes to skip */ #define JUMP_IF_FALSE 111 /* "" */ |