blob: 52ba12755ef97752fb7b0890ba992fac2294c06f [file] [log] [blame]
Thomas Wouterscf297e42007-02-23 15:07:44 +00001/* File automatically generated by Parser/asdl_c.py. */
Jeremy Hylton3e0055f2005-10-20 19:59:25 +00002
Victor Stinner5f2df882018-11-12 00:56:19 +01003#ifndef Py_PYTHON_AST_H
4#define Py_PYTHON_AST_H
5#ifdef __cplusplus
6extern "C" {
7#endif
8
Jeremy Hylton3e0055f2005-10-20 19:59:25 +00009#include "asdl.h"
10
Victor Stinner3bb183d2018-11-22 18:38:38 +010011#undef Yield /* undefine macro conflicting with <winbase.h> */
Victor Stinner5f2df882018-11-12 00:56:19 +010012
Jeremy Hylton3e0055f2005-10-20 19:59:25 +000013typedef struct _mod *mod_ty;
14
15typedef struct _stmt *stmt_ty;
16
17typedef struct _expr *expr_ty;
18
19typedef enum _expr_context { Load=1, Store=2, Del=3, AugLoad=4, AugStore=5,
Serhiy Storchakad8b3a982019-03-05 20:42:06 +020020 Param=6 } expr_context_ty;
Jeremy Hylton3e0055f2005-10-20 19:59:25 +000021
22typedef struct _slice *slice_ty;
23
24typedef enum _boolop { And=1, Or=2 } boolop_ty;
25
Benjamin Petersond51374e2014-04-09 23:55:56 -040026typedef enum _operator { Add=1, Sub=2, Mult=3, MatMult=4, Div=5, Mod=6, Pow=7,
27 LShift=8, RShift=9, BitOr=10, BitXor=11, BitAnd=12,
28 FloorDiv=13 } operator_ty;
Jeremy Hylton3e0055f2005-10-20 19:59:25 +000029
30typedef enum _unaryop { Invert=1, Not=2, UAdd=3, USub=4 } unaryop_ty;
31
32typedef enum _cmpop { Eq=1, NotEq=2, Lt=3, LtE=4, Gt=5, GtE=6, Is=7, IsNot=8,
33 In=9, NotIn=10 } cmpop_ty;
34
35typedef struct _comprehension *comprehension_ty;
36
37typedef struct _excepthandler *excepthandler_ty;
38
39typedef struct _arguments *arguments_ty;
40
Neal Norwitzc1505362006-12-28 06:47:50 +000041typedef struct _arg *arg_ty;
42
Jeremy Hylton3e0055f2005-10-20 19:59:25 +000043typedef struct _keyword *keyword_ty;
44
45typedef struct _alias *alias_ty;
46
Benjamin Petersonbf1bbc12011-05-27 13:58:08 -050047typedef struct _withitem *withitem_ty;
48
Guido van Rossumdcfcd142019-01-31 03:40:27 -080049typedef struct _type_ignore *type_ignore_ty;
50
Neal Norwitz7b5a6042005-11-13 19:14:20 +000051
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000052enum _mod_kind {Module_kind=1, Interactive_kind=2, Expression_kind=3,
Guido van Rossumdcfcd142019-01-31 03:40:27 -080053 FunctionType_kind=4, Suite_kind=5};
Jeremy Hylton3e0055f2005-10-20 19:59:25 +000054struct _mod {
Victor Stinnerce72e1c2013-07-27 00:00:36 +020055 enum _mod_kind kind;
56 union {
57 struct {
58 asdl_seq *body;
Guido van Rossumdcfcd142019-01-31 03:40:27 -080059 asdl_seq *type_ignores;
Victor Stinnerce72e1c2013-07-27 00:00:36 +020060 } Module;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +030061
Victor Stinnerce72e1c2013-07-27 00:00:36 +020062 struct {
63 asdl_seq *body;
64 } Interactive;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +030065
Victor Stinnerce72e1c2013-07-27 00:00:36 +020066 struct {
67 expr_ty body;
68 } Expression;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +030069
Victor Stinnerce72e1c2013-07-27 00:00:36 +020070 struct {
Guido van Rossumdcfcd142019-01-31 03:40:27 -080071 asdl_seq *argtypes;
72 expr_ty returns;
73 } FunctionType;
74
75 struct {
Victor Stinnerce72e1c2013-07-27 00:00:36 +020076 asdl_seq *body;
77 } Suite;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +030078
Victor Stinnerce72e1c2013-07-27 00:00:36 +020079 } v;
Jeremy Hylton3e0055f2005-10-20 19:59:25 +000080};
81
Yury Selivanov75445082015-05-11 22:57:16 -040082enum _stmt_kind {FunctionDef_kind=1, AsyncFunctionDef_kind=2, ClassDef_kind=3,
83 Return_kind=4, Delete_kind=5, Assign_kind=6,
Yury Selivanovf8cb8a12016-09-08 20:50:03 -070084 AugAssign_kind=7, AnnAssign_kind=8, For_kind=9,
85 AsyncFor_kind=10, While_kind=11, If_kind=12, With_kind=13,
86 AsyncWith_kind=14, Raise_kind=15, Try_kind=16,
87 Assert_kind=17, Import_kind=18, ImportFrom_kind=19,
88 Global_kind=20, Nonlocal_kind=21, Expr_kind=22, Pass_kind=23,
89 Break_kind=24, Continue_kind=25};
Jeremy Hylton3e0055f2005-10-20 19:59:25 +000090struct _stmt {
Victor Stinnerce72e1c2013-07-27 00:00:36 +020091 enum _stmt_kind kind;
92 union {
93 struct {
94 identifier name;
95 arguments_ty args;
96 asdl_seq *body;
97 asdl_seq *decorator_list;
98 expr_ty returns;
Guido van Rossumdcfcd142019-01-31 03:40:27 -080099 string type_comment;
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200100 } FunctionDef;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300101
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200102 struct {
103 identifier name;
Yury Selivanov75445082015-05-11 22:57:16 -0400104 arguments_ty args;
105 asdl_seq *body;
106 asdl_seq *decorator_list;
107 expr_ty returns;
Guido van Rossumdcfcd142019-01-31 03:40:27 -0800108 string type_comment;
Yury Selivanov75445082015-05-11 22:57:16 -0400109 } AsyncFunctionDef;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300110
Yury Selivanov75445082015-05-11 22:57:16 -0400111 struct {
112 identifier name;
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200113 asdl_seq *bases;
114 asdl_seq *keywords;
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200115 asdl_seq *body;
116 asdl_seq *decorator_list;
117 } ClassDef;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300118
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200119 struct {
120 expr_ty value;
121 } Return;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300122
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200123 struct {
124 asdl_seq *targets;
125 } Delete;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300126
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200127 struct {
128 asdl_seq *targets;
129 expr_ty value;
Guido van Rossumdcfcd142019-01-31 03:40:27 -0800130 string type_comment;
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200131 } Assign;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300132
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200133 struct {
134 expr_ty target;
135 operator_ty op;
136 expr_ty value;
137 } AugAssign;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300138
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200139 struct {
140 expr_ty target;
Yury Selivanovf8cb8a12016-09-08 20:50:03 -0700141 expr_ty annotation;
142 expr_ty value;
143 int simple;
144 } AnnAssign;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300145
Yury Selivanovf8cb8a12016-09-08 20:50:03 -0700146 struct {
147 expr_ty target;
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200148 expr_ty iter;
149 asdl_seq *body;
150 asdl_seq *orelse;
Guido van Rossumdcfcd142019-01-31 03:40:27 -0800151 string type_comment;
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200152 } For;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300153
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200154 struct {
Yury Selivanov75445082015-05-11 22:57:16 -0400155 expr_ty target;
156 expr_ty iter;
157 asdl_seq *body;
158 asdl_seq *orelse;
Guido van Rossumdcfcd142019-01-31 03:40:27 -0800159 string type_comment;
Yury Selivanov75445082015-05-11 22:57:16 -0400160 } AsyncFor;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300161
Yury Selivanov75445082015-05-11 22:57:16 -0400162 struct {
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200163 expr_ty test;
164 asdl_seq *body;
165 asdl_seq *orelse;
166 } While;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300167
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200168 struct {
169 expr_ty test;
170 asdl_seq *body;
171 asdl_seq *orelse;
172 } If;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300173
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200174 struct {
175 asdl_seq *items;
176 asdl_seq *body;
Guido van Rossumdcfcd142019-01-31 03:40:27 -0800177 string type_comment;
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200178 } With;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300179
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200180 struct {
Yury Selivanov75445082015-05-11 22:57:16 -0400181 asdl_seq *items;
182 asdl_seq *body;
Guido van Rossumdcfcd142019-01-31 03:40:27 -0800183 string type_comment;
Yury Selivanov75445082015-05-11 22:57:16 -0400184 } AsyncWith;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300185
Yury Selivanov75445082015-05-11 22:57:16 -0400186 struct {
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200187 expr_ty exc;
188 expr_ty cause;
189 } Raise;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300190
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200191 struct {
192 asdl_seq *body;
193 asdl_seq *handlers;
194 asdl_seq *orelse;
195 asdl_seq *finalbody;
196 } Try;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300197
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200198 struct {
199 expr_ty test;
200 expr_ty msg;
201 } Assert;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300202
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200203 struct {
204 asdl_seq *names;
205 } Import;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300206
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200207 struct {
208 identifier module;
209 asdl_seq *names;
210 int level;
211 } ImportFrom;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300212
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200213 struct {
214 asdl_seq *names;
215 } Global;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300216
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200217 struct {
218 asdl_seq *names;
219 } Nonlocal;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300220
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200221 struct {
222 expr_ty value;
223 } Expr;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300224
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200225 } v;
226 int lineno;
227 int col_offset;
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000228 int end_lineno;
229 int end_col_offset;
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000230};
231
Emily Morehouse8f59ee02019-01-24 16:49:56 -0700232enum _expr_kind {BoolOp_kind=1, NamedExpr_kind=2, BinOp_kind=3, UnaryOp_kind=4,
233 Lambda_kind=5, IfExp_kind=6, Dict_kind=7, Set_kind=8,
234 ListComp_kind=9, SetComp_kind=10, DictComp_kind=11,
235 GeneratorExp_kind=12, Await_kind=13, Yield_kind=14,
236 YieldFrom_kind=15, Compare_kind=16, Call_kind=17,
237 FormattedValue_kind=18, JoinedStr_kind=19, Constant_kind=20,
238 Attribute_kind=21, Subscript_kind=22, Starred_kind=23,
239 Name_kind=24, List_kind=25, Tuple_kind=26};
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000240struct _expr {
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200241 enum _expr_kind kind;
242 union {
243 struct {
244 boolop_ty op;
245 asdl_seq *values;
246 } BoolOp;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300247
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200248 struct {
Emily Morehouse8f59ee02019-01-24 16:49:56 -0700249 expr_ty target;
250 expr_ty value;
251 } NamedExpr;
252
253 struct {
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200254 expr_ty left;
255 operator_ty op;
256 expr_ty right;
257 } BinOp;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300258
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200259 struct {
260 unaryop_ty op;
261 expr_ty operand;
262 } UnaryOp;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300263
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200264 struct {
265 arguments_ty args;
266 expr_ty body;
267 } Lambda;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300268
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200269 struct {
270 expr_ty test;
271 expr_ty body;
272 expr_ty orelse;
273 } IfExp;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300274
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200275 struct {
276 asdl_seq *keys;
277 asdl_seq *values;
278 } Dict;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300279
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200280 struct {
281 asdl_seq *elts;
282 } Set;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300283
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200284 struct {
285 expr_ty elt;
286 asdl_seq *generators;
287 } ListComp;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300288
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200289 struct {
290 expr_ty elt;
291 asdl_seq *generators;
292 } SetComp;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300293
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200294 struct {
295 expr_ty key;
296 expr_ty value;
297 asdl_seq *generators;
298 } DictComp;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300299
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200300 struct {
301 expr_ty elt;
302 asdl_seq *generators;
303 } GeneratorExp;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300304
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200305 struct {
306 expr_ty value;
Yury Selivanov75445082015-05-11 22:57:16 -0400307 } Await;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300308
Yury Selivanov75445082015-05-11 22:57:16 -0400309 struct {
310 expr_ty value;
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200311 } Yield;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300312
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200313 struct {
314 expr_ty value;
315 } YieldFrom;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300316
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200317 struct {
318 expr_ty left;
319 asdl_int_seq *ops;
320 asdl_seq *comparators;
321 } Compare;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300322
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200323 struct {
324 expr_ty func;
325 asdl_seq *args;
326 asdl_seq *keywords;
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200327 } Call;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300328
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200329 struct {
Eric V. Smith235a6f02015-09-19 14:51:32 -0400330 expr_ty value;
331 int conversion;
332 expr_ty format_spec;
333 } FormattedValue;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300334
Eric V. Smith235a6f02015-09-19 14:51:32 -0400335 struct {
336 asdl_seq *values;
337 } JoinedStr;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300338
Eric V. Smith235a6f02015-09-19 14:51:32 -0400339 struct {
Victor Stinnerf2c1aa12016-01-26 00:40:57 +0100340 constant value;
341 } Constant;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300342
Victor Stinnerf2c1aa12016-01-26 00:40:57 +0100343 struct {
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200344 expr_ty value;
345 identifier attr;
346 expr_context_ty ctx;
347 } Attribute;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300348
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200349 struct {
350 expr_ty value;
351 slice_ty slice;
352 expr_context_ty ctx;
353 } Subscript;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300354
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200355 struct {
356 expr_ty value;
357 expr_context_ty ctx;
358 } Starred;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300359
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200360 struct {
361 identifier id;
362 expr_context_ty ctx;
363 } Name;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300364
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200365 struct {
366 asdl_seq *elts;
367 expr_context_ty ctx;
368 } List;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300369
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200370 struct {
371 asdl_seq *elts;
372 expr_context_ty ctx;
373 } Tuple;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300374
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200375 } v;
376 int lineno;
377 int col_offset;
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000378 int end_lineno;
379 int end_col_offset;
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000380};
381
Georg Brandl52318d62006-09-06 07:06:08 +0000382enum _slice_kind {Slice_kind=1, ExtSlice_kind=2, Index_kind=3};
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000383struct _slice {
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200384 enum _slice_kind kind;
385 union {
386 struct {
387 expr_ty lower;
388 expr_ty upper;
389 expr_ty step;
390 } Slice;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300391
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200392 struct {
393 asdl_seq *dims;
394 } ExtSlice;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300395
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200396 struct {
397 expr_ty value;
398 } Index;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300399
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200400 } v;
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000401};
402
403struct _comprehension {
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200404 expr_ty target;
405 expr_ty iter;
406 asdl_seq *ifs;
Yury Selivanov52c4e7c2016-09-09 10:36:01 -0700407 int is_async;
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000408};
409
Neal Norwitzad74aa82008-03-31 05:14:30 +0000410enum _excepthandler_kind {ExceptHandler_kind=1};
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000411struct _excepthandler {
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200412 enum _excepthandler_kind kind;
413 union {
414 struct {
415 expr_ty type;
416 identifier name;
417 asdl_seq *body;
418 } ExceptHandler;
Serhiy Storchaka5d84cb32017-09-15 06:28:22 +0300419
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200420 } v;
421 int lineno;
422 int col_offset;
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000423 int end_lineno;
424 int end_col_offset;
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000425};
426
427struct _arguments {
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200428 asdl_seq *args;
Victor Stinneree4b59c2013-07-27 00:01:35 +0200429 arg_ty vararg;
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200430 asdl_seq *kwonlyargs;
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200431 asdl_seq *kw_defaults;
Victor Stinneree4b59c2013-07-27 00:01:35 +0200432 arg_ty kwarg;
433 asdl_seq *defaults;
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000434};
435
Neal Norwitzc1505362006-12-28 06:47:50 +0000436struct _arg {
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200437 identifier arg;
438 expr_ty annotation;
Guido van Rossumdcfcd142019-01-31 03:40:27 -0800439 string type_comment;
Victor Stinneree4b59c2013-07-27 00:01:35 +0200440 int lineno;
441 int col_offset;
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000442 int end_lineno;
443 int end_col_offset;
Neal Norwitzc1505362006-12-28 06:47:50 +0000444};
445
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000446struct _keyword {
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200447 identifier arg;
448 expr_ty value;
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000449};
450
451struct _alias {
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200452 identifier name;
453 identifier asname;
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000454};
455
Benjamin Petersonbf1bbc12011-05-27 13:58:08 -0500456struct _withitem {
Victor Stinnerce72e1c2013-07-27 00:00:36 +0200457 expr_ty context_expr;
458 expr_ty optional_vars;
Benjamin Petersonbf1bbc12011-05-27 13:58:08 -0500459};
460
Guido van Rossumdcfcd142019-01-31 03:40:27 -0800461enum _type_ignore_kind {TypeIgnore_kind=1};
462struct _type_ignore {
463 enum _type_ignore_kind kind;
464 union {
465 struct {
466 int lineno;
467 } TypeIgnore;
468
469 } v;
470};
471
Neal Norwitz7b5a6042005-11-13 19:14:20 +0000472
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000473// Note: these macros affect function definitions, not only call sites.
Guido van Rossumdcfcd142019-01-31 03:40:27 -0800474#define Module(a0, a1, a2) _Py_Module(a0, a1, a2)
475mod_ty _Py_Module(asdl_seq * body, asdl_seq * type_ignores, PyArena *arena);
Thomas Woutersb2137042007-02-01 18:02:27 +0000476#define Interactive(a0, a1) _Py_Interactive(a0, a1)
477mod_ty _Py_Interactive(asdl_seq * body, PyArena *arena);
478#define Expression(a0, a1) _Py_Expression(a0, a1)
479mod_ty _Py_Expression(expr_ty body, PyArena *arena);
Guido van Rossumdcfcd142019-01-31 03:40:27 -0800480#define FunctionType(a0, a1, a2) _Py_FunctionType(a0, a1, a2)
481mod_ty _Py_FunctionType(asdl_seq * argtypes, expr_ty returns, PyArena *arena);
Thomas Woutersb2137042007-02-01 18:02:27 +0000482#define Suite(a0, a1) _Py_Suite(a0, a1)
483mod_ty _Py_Suite(asdl_seq * body, PyArena *arena);
Guido van Rossumdcfcd142019-01-31 03:40:27 -0800484#define FunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) _Py_FunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
Thomas Woutersb2137042007-02-01 18:02:27 +0000485stmt_ty _Py_FunctionDef(identifier name, arguments_ty args, asdl_seq * body,
Guido van Rossumdcfcd142019-01-31 03:40:27 -0800486 asdl_seq * decorator_list, expr_ty returns, string
487 type_comment, int lineno, int col_offset, int
488 end_lineno, int end_col_offset, PyArena *arena);
489#define AsyncFunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) _Py_AsyncFunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
Yury Selivanov75445082015-05-11 22:57:16 -0400490stmt_ty _Py_AsyncFunctionDef(identifier name, arguments_ty args, asdl_seq *
491 body, asdl_seq * decorator_list, expr_ty returns,
Guido van Rossumdcfcd142019-01-31 03:40:27 -0800492 string type_comment, int lineno, int col_offset,
493 int end_lineno, int end_col_offset, PyArena
494 *arena);
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000495#define ClassDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) _Py_ClassDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)
Guido van Rossum52cc1d82007-03-18 15:41:51 +0000496stmt_ty _Py_ClassDef(identifier name, asdl_seq * bases, asdl_seq * keywords,
Serhiy Storchaka73cbe7a2018-05-29 12:04:55 +0300497 asdl_seq * body, asdl_seq * decorator_list, int lineno,
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000498 int col_offset, int end_lineno, int end_col_offset,
499 PyArena *arena);
500#define Return(a0, a1, a2, a3, a4, a5) _Py_Return(a0, a1, a2, a3, a4, a5)
501stmt_ty _Py_Return(expr_ty value, int lineno, int col_offset, int end_lineno,
502 int end_col_offset, PyArena *arena);
503#define Delete(a0, a1, a2, a3, a4, a5) _Py_Delete(a0, a1, a2, a3, a4, a5)
504stmt_ty _Py_Delete(asdl_seq * targets, int lineno, int col_offset, int
505 end_lineno, int end_col_offset, PyArena *arena);
Guido van Rossumdcfcd142019-01-31 03:40:27 -0800506#define Assign(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Assign(a0, a1, a2, a3, a4, a5, a6, a7)
507stmt_ty _Py_Assign(asdl_seq * targets, expr_ty value, string type_comment, int
508 lineno, int col_offset, int end_lineno, int end_col_offset,
509 PyArena *arena);
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000510#define AugAssign(a0, a1, a2, a3, a4, a5, a6, a7) _Py_AugAssign(a0, a1, a2, a3, a4, a5, a6, a7)
Thomas Woutersb2137042007-02-01 18:02:27 +0000511stmt_ty _Py_AugAssign(expr_ty target, operator_ty op, expr_ty value, int
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000512 lineno, int col_offset, int end_lineno, int
513 end_col_offset, PyArena *arena);
514#define AnnAssign(a0, a1, a2, a3, a4, a5, a6, a7, a8) _Py_AnnAssign(a0, a1, a2, a3, a4, a5, a6, a7, a8)
Yury Selivanovf8cb8a12016-09-08 20:50:03 -0700515stmt_ty _Py_AnnAssign(expr_ty target, expr_ty annotation, expr_ty value, int
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000516 simple, int lineno, int col_offset, int end_lineno, int
517 end_col_offset, PyArena *arena);
Guido van Rossumdcfcd142019-01-31 03:40:27 -0800518#define For(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) _Py_For(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)
Thomas Woutersb2137042007-02-01 18:02:27 +0000519stmt_ty _Py_For(expr_ty target, expr_ty iter, asdl_seq * body, asdl_seq *
Guido van Rossumdcfcd142019-01-31 03:40:27 -0800520 orelse, string type_comment, int lineno, int col_offset, int
521 end_lineno, int end_col_offset, PyArena *arena);
522#define AsyncFor(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) _Py_AsyncFor(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)
Yury Selivanov75445082015-05-11 22:57:16 -0400523stmt_ty _Py_AsyncFor(expr_ty target, expr_ty iter, asdl_seq * body, asdl_seq *
Guido van Rossumdcfcd142019-01-31 03:40:27 -0800524 orelse, string type_comment, int lineno, int col_offset,
525 int end_lineno, int end_col_offset, PyArena *arena);
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000526#define While(a0, a1, a2, a3, a4, a5, a6, a7) _Py_While(a0, a1, a2, a3, a4, a5, a6, a7)
Thomas Woutersb2137042007-02-01 18:02:27 +0000527stmt_ty _Py_While(expr_ty test, asdl_seq * body, asdl_seq * orelse, int lineno,
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000528 int col_offset, int end_lineno, int end_col_offset, PyArena
529 *arena);
530#define If(a0, a1, a2, a3, a4, a5, a6, a7) _Py_If(a0, a1, a2, a3, a4, a5, a6, a7)
Thomas Woutersb2137042007-02-01 18:02:27 +0000531stmt_ty _Py_If(expr_ty test, asdl_seq * body, asdl_seq * orelse, int lineno,
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000532 int col_offset, int end_lineno, int end_col_offset, PyArena
533 *arena);
Guido van Rossumdcfcd142019-01-31 03:40:27 -0800534#define With(a0, a1, a2, a3, a4, a5, a6, a7) _Py_With(a0, a1, a2, a3, a4, a5, a6, a7)
535stmt_ty _Py_With(asdl_seq * items, asdl_seq * body, string type_comment, int
536 lineno, int col_offset, int end_lineno, int end_col_offset,
537 PyArena *arena);
538#define AsyncWith(a0, a1, a2, a3, a4, a5, a6, a7) _Py_AsyncWith(a0, a1, a2, a3, a4, a5, a6, a7)
539stmt_ty _Py_AsyncWith(asdl_seq * items, asdl_seq * body, string type_comment,
540 int lineno, int col_offset, int end_lineno, int
541 end_col_offset, PyArena *arena);
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000542#define Raise(a0, a1, a2, a3, a4, a5, a6) _Py_Raise(a0, a1, a2, a3, a4, a5, a6)
543stmt_ty _Py_Raise(expr_ty exc, expr_ty cause, int lineno, int col_offset, int
544 end_lineno, int end_col_offset, PyArena *arena);
545#define Try(a0, a1, a2, a3, a4, a5, a6, a7, a8) _Py_Try(a0, a1, a2, a3, a4, a5, a6, a7, a8)
Benjamin Peterson43af12b2011-05-29 11:43:10 -0500546stmt_ty _Py_Try(asdl_seq * body, asdl_seq * handlers, asdl_seq * orelse,
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000547 asdl_seq * finalbody, int lineno, int col_offset, int
548 end_lineno, int end_col_offset, PyArena *arena);
549#define Assert(a0, a1, a2, a3, a4, a5, a6) _Py_Assert(a0, a1, a2, a3, a4, a5, a6)
550stmt_ty _Py_Assert(expr_ty test, expr_ty msg, int lineno, int col_offset, int
551 end_lineno, int end_col_offset, PyArena *arena);
552#define Import(a0, a1, a2, a3, a4, a5) _Py_Import(a0, a1, a2, a3, a4, a5)
553stmt_ty _Py_Import(asdl_seq * names, int lineno, int col_offset, int
554 end_lineno, int end_col_offset, PyArena *arena);
555#define ImportFrom(a0, a1, a2, a3, a4, a5, a6, a7) _Py_ImportFrom(a0, a1, a2, a3, a4, a5, a6, a7)
Thomas Woutersb2137042007-02-01 18:02:27 +0000556stmt_ty _Py_ImportFrom(identifier module, asdl_seq * names, int level, int
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000557 lineno, int col_offset, int end_lineno, int
558 end_col_offset, PyArena *arena);
559#define Global(a0, a1, a2, a3, a4, a5) _Py_Global(a0, a1, a2, a3, a4, a5)
560stmt_ty _Py_Global(asdl_seq * names, int lineno, int col_offset, int
561 end_lineno, int end_col_offset, PyArena *arena);
562#define Nonlocal(a0, a1, a2, a3, a4, a5) _Py_Nonlocal(a0, a1, a2, a3, a4, a5)
563stmt_ty _Py_Nonlocal(asdl_seq * names, int lineno, int col_offset, int
564 end_lineno, int end_col_offset, PyArena *arena);
565#define Expr(a0, a1, a2, a3, a4, a5) _Py_Expr(a0, a1, a2, a3, a4, a5)
566stmt_ty _Py_Expr(expr_ty value, int lineno, int col_offset, int end_lineno, int
567 end_col_offset, PyArena *arena);
568#define Pass(a0, a1, a2, a3, a4) _Py_Pass(a0, a1, a2, a3, a4)
569stmt_ty _Py_Pass(int lineno, int col_offset, int end_lineno, int
570 end_col_offset, PyArena *arena);
571#define Break(a0, a1, a2, a3, a4) _Py_Break(a0, a1, a2, a3, a4)
572stmt_ty _Py_Break(int lineno, int col_offset, int end_lineno, int
573 end_col_offset, PyArena *arena);
574#define Continue(a0, a1, a2, a3, a4) _Py_Continue(a0, a1, a2, a3, a4)
575stmt_ty _Py_Continue(int lineno, int col_offset, int end_lineno, int
576 end_col_offset, PyArena *arena);
577#define BoolOp(a0, a1, a2, a3, a4, a5, a6) _Py_BoolOp(a0, a1, a2, a3, a4, a5, a6)
Thomas Woutersb2137042007-02-01 18:02:27 +0000578expr_ty _Py_BoolOp(boolop_ty op, asdl_seq * values, int lineno, int col_offset,
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000579 int end_lineno, int end_col_offset, PyArena *arena);
Emily Morehouse8f59ee02019-01-24 16:49:56 -0700580#define NamedExpr(a0, a1, a2, a3, a4, a5, a6) _Py_NamedExpr(a0, a1, a2, a3, a4, a5, a6)
581expr_ty _Py_NamedExpr(expr_ty target, expr_ty value, int lineno, int
582 col_offset, int end_lineno, int end_col_offset, PyArena
583 *arena);
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000584#define BinOp(a0, a1, a2, a3, a4, a5, a6, a7) _Py_BinOp(a0, a1, a2, a3, a4, a5, a6, a7)
Thomas Woutersb2137042007-02-01 18:02:27 +0000585expr_ty _Py_BinOp(expr_ty left, operator_ty op, expr_ty right, int lineno, int
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000586 col_offset, int end_lineno, int end_col_offset, PyArena
587 *arena);
588#define UnaryOp(a0, a1, a2, a3, a4, a5, a6) _Py_UnaryOp(a0, a1, a2, a3, a4, a5, a6)
Thomas Woutersb2137042007-02-01 18:02:27 +0000589expr_ty _Py_UnaryOp(unaryop_ty op, expr_ty operand, int lineno, int col_offset,
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000590 int end_lineno, int end_col_offset, PyArena *arena);
591#define Lambda(a0, a1, a2, a3, a4, a5, a6) _Py_Lambda(a0, a1, a2, a3, a4, a5, a6)
Thomas Woutersb2137042007-02-01 18:02:27 +0000592expr_ty _Py_Lambda(arguments_ty args, expr_ty body, int lineno, int col_offset,
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000593 int end_lineno, int end_col_offset, PyArena *arena);
594#define IfExp(a0, a1, a2, a3, a4, a5, a6, a7) _Py_IfExp(a0, a1, a2, a3, a4, a5, a6, a7)
Thomas Woutersb2137042007-02-01 18:02:27 +0000595expr_ty _Py_IfExp(expr_ty test, expr_ty body, expr_ty orelse, int lineno, int
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000596 col_offset, int end_lineno, int end_col_offset, PyArena
597 *arena);
598#define Dict(a0, a1, a2, a3, a4, a5, a6) _Py_Dict(a0, a1, a2, a3, a4, a5, a6)
Thomas Woutersb2137042007-02-01 18:02:27 +0000599expr_ty _Py_Dict(asdl_seq * keys, asdl_seq * values, int lineno, int
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000600 col_offset, int end_lineno, int end_col_offset, PyArena
601 *arena);
602#define Set(a0, a1, a2, a3, a4, a5) _Py_Set(a0, a1, a2, a3, a4, a5)
603expr_ty _Py_Set(asdl_seq * elts, int lineno, int col_offset, int end_lineno,
604 int end_col_offset, PyArena *arena);
605#define ListComp(a0, a1, a2, a3, a4, a5, a6) _Py_ListComp(a0, a1, a2, a3, a4, a5, a6)
Thomas Woutersb2137042007-02-01 18:02:27 +0000606expr_ty _Py_ListComp(expr_ty elt, asdl_seq * generators, int lineno, int
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000607 col_offset, int end_lineno, int end_col_offset, PyArena
Victor Stinnerf2c1aa12016-01-26 00:40:57 +0100608 *arena);
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000609#define SetComp(a0, a1, a2, a3, a4, a5, a6) _Py_SetComp(a0, a1, a2, a3, a4, a5, a6)
610expr_ty _Py_SetComp(expr_ty elt, asdl_seq * generators, int lineno, int
611 col_offset, int end_lineno, int end_col_offset, PyArena
612 *arena);
613#define DictComp(a0, a1, a2, a3, a4, a5, a6, a7) _Py_DictComp(a0, a1, a2, a3, a4, a5, a6, a7)
614expr_ty _Py_DictComp(expr_ty key, expr_ty value, asdl_seq * generators, int
615 lineno, int col_offset, int end_lineno, int
616 end_col_offset, PyArena *arena);
617#define GeneratorExp(a0, a1, a2, a3, a4, a5, a6) _Py_GeneratorExp(a0, a1, a2, a3, a4, a5, a6)
618expr_ty _Py_GeneratorExp(expr_ty elt, asdl_seq * generators, int lineno, int
619 col_offset, int end_lineno, int end_col_offset,
620 PyArena *arena);
621#define Await(a0, a1, a2, a3, a4, a5) _Py_Await(a0, a1, a2, a3, a4, a5)
622expr_ty _Py_Await(expr_ty value, int lineno, int col_offset, int end_lineno,
623 int end_col_offset, PyArena *arena);
624#define Yield(a0, a1, a2, a3, a4, a5) _Py_Yield(a0, a1, a2, a3, a4, a5)
625expr_ty _Py_Yield(expr_ty value, int lineno, int col_offset, int end_lineno,
626 int end_col_offset, PyArena *arena);
627#define YieldFrom(a0, a1, a2, a3, a4, a5) _Py_YieldFrom(a0, a1, a2, a3, a4, a5)
628expr_ty _Py_YieldFrom(expr_ty value, int lineno, int col_offset, int
629 end_lineno, int end_col_offset, PyArena *arena);
630#define Compare(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Compare(a0, a1, a2, a3, a4, a5, a6, a7)
631expr_ty _Py_Compare(expr_ty left, asdl_int_seq * ops, asdl_seq * comparators,
632 int lineno, int col_offset, int end_lineno, int
633 end_col_offset, PyArena *arena);
634#define Call(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Call(a0, a1, a2, a3, a4, a5, a6, a7)
635expr_ty _Py_Call(expr_ty func, asdl_seq * args, asdl_seq * keywords, int
636 lineno, int col_offset, int end_lineno, int end_col_offset,
637 PyArena *arena);
638#define FormattedValue(a0, a1, a2, a3, a4, a5, a6, a7) _Py_FormattedValue(a0, a1, a2, a3, a4, a5, a6, a7)
639expr_ty _Py_FormattedValue(expr_ty value, int conversion, expr_ty format_spec,
640 int lineno, int col_offset, int end_lineno, int
641 end_col_offset, PyArena *arena);
642#define JoinedStr(a0, a1, a2, a3, a4, a5) _Py_JoinedStr(a0, a1, a2, a3, a4, a5)
643expr_ty _Py_JoinedStr(asdl_seq * values, int lineno, int col_offset, int
644 end_lineno, int end_col_offset, PyArena *arena);
645#define Constant(a0, a1, a2, a3, a4, a5) _Py_Constant(a0, a1, a2, a3, a4, a5)
646expr_ty _Py_Constant(constant value, int lineno, int col_offset, int
647 end_lineno, int end_col_offset, PyArena *arena);
648#define Attribute(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Attribute(a0, a1, a2, a3, a4, a5, a6, a7)
Thomas Woutersb2137042007-02-01 18:02:27 +0000649expr_ty _Py_Attribute(expr_ty value, identifier attr, expr_context_ty ctx, int
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000650 lineno, int col_offset, int end_lineno, int
651 end_col_offset, PyArena *arena);
652#define Subscript(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Subscript(a0, a1, a2, a3, a4, a5, a6, a7)
Thomas Woutersb2137042007-02-01 18:02:27 +0000653expr_ty _Py_Subscript(expr_ty value, slice_ty slice, expr_context_ty ctx, int
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000654 lineno, int col_offset, int end_lineno, int
655 end_col_offset, PyArena *arena);
656#define Starred(a0, a1, a2, a3, a4, a5, a6) _Py_Starred(a0, a1, a2, a3, a4, a5, a6)
Guido van Rossum0368b722007-05-11 16:50:42 +0000657expr_ty _Py_Starred(expr_ty value, expr_context_ty ctx, int lineno, int
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000658 col_offset, int end_lineno, int end_col_offset, PyArena
659 *arena);
660#define Name(a0, a1, a2, a3, a4, a5, a6) _Py_Name(a0, a1, a2, a3, a4, a5, a6)
Thomas Woutersb2137042007-02-01 18:02:27 +0000661expr_ty _Py_Name(identifier id, expr_context_ty ctx, int lineno, int
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000662 col_offset, int end_lineno, int end_col_offset, PyArena
663 *arena);
664#define List(a0, a1, a2, a3, a4, a5, a6) _Py_List(a0, a1, a2, a3, a4, a5, a6)
Thomas Woutersb2137042007-02-01 18:02:27 +0000665expr_ty _Py_List(asdl_seq * elts, expr_context_ty ctx, int lineno, int
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000666 col_offset, int end_lineno, int end_col_offset, PyArena
667 *arena);
668#define Tuple(a0, a1, a2, a3, a4, a5, a6) _Py_Tuple(a0, a1, a2, a3, a4, a5, a6)
Thomas Woutersb2137042007-02-01 18:02:27 +0000669expr_ty _Py_Tuple(asdl_seq * elts, expr_context_ty ctx, int lineno, int
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000670 col_offset, int end_lineno, int end_col_offset, PyArena
671 *arena);
Thomas Woutersb2137042007-02-01 18:02:27 +0000672#define Slice(a0, a1, a2, a3) _Py_Slice(a0, a1, a2, a3)
673slice_ty _Py_Slice(expr_ty lower, expr_ty upper, expr_ty step, PyArena *arena);
674#define ExtSlice(a0, a1) _Py_ExtSlice(a0, a1)
675slice_ty _Py_ExtSlice(asdl_seq * dims, PyArena *arena);
676#define Index(a0, a1) _Py_Index(a0, a1)
677slice_ty _Py_Index(expr_ty value, PyArena *arena);
Yury Selivanov52c4e7c2016-09-09 10:36:01 -0700678#define comprehension(a0, a1, a2, a3, a4) _Py_comprehension(a0, a1, a2, a3, a4)
Thomas Woutersb2137042007-02-01 18:02:27 +0000679comprehension_ty _Py_comprehension(expr_ty target, expr_ty iter, asdl_seq *
Yury Selivanov52c4e7c2016-09-09 10:36:01 -0700680 ifs, int is_async, PyArena *arena);
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000681#define ExceptHandler(a0, a1, a2, a3, a4, a5, a6, a7) _Py_ExceptHandler(a0, a1, a2, a3, a4, a5, a6, a7)
Neal Norwitzad74aa82008-03-31 05:14:30 +0000682excepthandler_ty _Py_ExceptHandler(expr_ty type, identifier name, asdl_seq *
Ivan Levkivskyi9932a222019-01-22 11:18:22 +0000683 body, int lineno, int col_offset, int
684 end_lineno, int end_col_offset, PyArena
Thomas Woutersb2137042007-02-01 18:02:27 +0000685 *arena);
Benjamin Petersoncda75be2013-03-18 10:48:58 -0700686#define arguments(a0, a1, a2, a3, a4, a5, a6) _Py_arguments(a0, a1, a2, a3, a4, a5, a6)
687arguments_ty _Py_arguments(asdl_seq * args, arg_ty vararg, asdl_seq *
688 kwonlyargs, asdl_seq * kw_defaults, arg_ty kwarg,
689 asdl_seq * defaults, PyArena *arena);
Guido van Rossumdcfcd142019-01-31 03:40:27 -0800690#define arg(a0, a1, a2, a3, a4, a5, a6, a7) _Py_arg(a0, a1, a2, a3, a4, a5, a6, a7)
691arg_ty _Py_arg(identifier arg, expr_ty annotation, string type_comment, int
692 lineno, int col_offset, int end_lineno, int end_col_offset,
693 PyArena *arena);
Thomas Woutersb2137042007-02-01 18:02:27 +0000694#define keyword(a0, a1, a2) _Py_keyword(a0, a1, a2)
695keyword_ty _Py_keyword(identifier arg, expr_ty value, PyArena *arena);
696#define alias(a0, a1, a2) _Py_alias(a0, a1, a2)
697alias_ty _Py_alias(identifier name, identifier asname, PyArena *arena);
Benjamin Petersonbf1bbc12011-05-27 13:58:08 -0500698#define withitem(a0, a1, a2) _Py_withitem(a0, a1, a2)
699withitem_ty _Py_withitem(expr_ty context_expr, expr_ty optional_vars, PyArena
700 *arena);
Guido van Rossumdcfcd142019-01-31 03:40:27 -0800701#define TypeIgnore(a0, a1) _Py_TypeIgnore(a0, a1)
702type_ignore_ty _Py_TypeIgnore(int lineno, PyArena *arena);
Neal Norwitz7b5a6042005-11-13 19:14:20 +0000703
Martin v. Löwisbd260da2006-02-26 19:42:26 +0000704PyObject* PyAST_mod2obj(mod_ty t);
Neal Norwitzdb4115f2008-03-31 04:20:05 +0000705mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode);
Martin v. Löwis618dc5e2008-03-30 20:03:44 +0000706int PyAST_Check(PyObject* obj);
Victor Stinner5f2df882018-11-12 00:56:19 +0100707
708#ifdef __cplusplus
709}
710#endif
711#endif /* !Py_PYTHON_AST_H */