bpo-29463: Add docstring field to some AST nodes. (#46) · python/cpython@cb41b27 (original) (raw)
`@@ -46,6 +46,7 @@ struct _mod {
`
46
46
`union {
`
47
47
`struct {
`
48
48
`asdl_seq *body;
`
``
49
`+
string docstring;
`
49
50
` } Module;
`
50
51
``
51
52
`struct {
`
`@@ -80,6 +81,7 @@ struct _stmt {
`
80
81
`asdl_seq *body;
`
81
82
`asdl_seq *decorator_list;
`
82
83
`expr_ty returns;
`
``
84
`+
string docstring;
`
83
85
` } FunctionDef;
`
84
86
``
85
87
`struct {
`
`@@ -88,6 +90,7 @@ struct _stmt {
`
88
90
`asdl_seq *body;
`
89
91
`asdl_seq *decorator_list;
`
90
92
`expr_ty returns;
`
``
93
`+
string docstring;
`
91
94
` } AsyncFunctionDef;
`
92
95
``
93
96
`struct {
`
`@@ -96,6 +99,7 @@ struct _stmt {
`
96
99
`asdl_seq *keywords;
`
97
100
`asdl_seq *body;
`
98
101
`asdl_seq *decorator_list;
`
``
102
`+
string docstring;
`
99
103
` } ClassDef;
`
100
104
``
101
105
`struct {
`
`@@ -439,26 +443,27 @@ struct _withitem {
`
439
443
`};
`
440
444
``
441
445
``
442
``
`-
#define Module(a0, a1) _Py_Module(a0, a1)
`
443
``
`-
mod_ty _Py_Module(asdl_seq * body, PyArena *arena);
`
``
446
`+
#define Module(a0, a1, a2) _Py_Module(a0, a1, a2)
`
``
447
`+
mod_ty _Py_Module(asdl_seq * body, string docstring, PyArena *arena);
`
444
448
`#define Interactive(a0, a1) _Py_Interactive(a0, a1)
`
445
449
`mod_ty _Py_Interactive(asdl_seq * body, PyArena *arena);
`
446
450
`#define Expression(a0, a1) _Py_Expression(a0, a1)
`
447
451
`mod_ty _Py_Expression(expr_ty body, PyArena *arena);
`
448
452
`#define Suite(a0, a1) _Py_Suite(a0, a1)
`
449
453
`mod_ty _Py_Suite(asdl_seq * body, PyArena *arena);
`
450
``
`-
#define FunctionDef(a0, a1, a2, a3, a4, a5, a6, a7) _Py_FunctionDef(a0, a1, a2, a3, a4, a5, a6, a7)
`
``
454
`+
#define FunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8) _Py_FunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8)
`
451
455
`stmt_ty _Py_FunctionDef(identifier name, arguments_ty args, asdl_seq * body,
`
452
``
`-
asdl_seq * decorator_list, expr_ty returns, int lineno,
`
453
``
`-
int col_offset, PyArena *arena);
`
454
``
`-
#define AsyncFunctionDef(a0, a1, a2, a3, a4, a5, a6, a7) _Py_AsyncFunctionDef(a0, a1, a2, a3, a4, a5, a6, a7)
`
``
456
`+
asdl_seq * decorator_list, expr_ty returns, string
`
``
457
`+
docstring, int lineno, int col_offset, PyArena *arena);
`
``
458
`+
#define AsyncFunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8) _Py_AsyncFunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8)
`
455
459
`stmt_ty _Py_AsyncFunctionDef(identifier name, arguments_ty args, asdl_seq *
`
456
460
`body, asdl_seq * decorator_list, expr_ty returns,
`
457
``
`-
int lineno, int col_offset, PyArena *arena);
`
458
``
`-
#define ClassDef(a0, a1, a2, a3, a4, a5, a6, a7) _Py_ClassDef(a0, a1, a2, a3, a4, a5, a6, a7)
`
``
461
`+
string docstring, int lineno, int col_offset,
`
``
462
`+
PyArena *arena);
`
``
463
`+
#define ClassDef(a0, a1, a2, a3, a4, a5, a6, a7, a8) _Py_ClassDef(a0, a1, a2, a3, a4, a5, a6, a7, a8)
`
459
464
`stmt_ty _Py_ClassDef(identifier name, asdl_seq * bases, asdl_seq * keywords,
`
460
``
`-
asdl_seq * body, asdl_seq * decorator_list, int lineno,
`
461
``
`-
int col_offset, PyArena *arena);
`
``
465
`+
asdl_seq * body, asdl_seq * decorator_list, string
`
``
466
`+
docstring, int lineno, int col_offset, PyArena *arena);
`
462
467
`#define Return(a0, a1, a2, a3) _Py_Return(a0, a1, a2, a3)
`
463
468
`stmt_ty _Py_Return(expr_ty value, int lineno, int col_offset, PyArena *arena);
`
464
469
`#define Delete(a0, a1, a2, a3) _Py_Delete(a0, a1, a2, a3)
`