mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
gh-104799: Move location of type_params AST fields (#104828)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
6e1eccdcce
commit
ba73473f4c
9 changed files with 297 additions and 266 deletions
|
@ -752,22 +752,25 @@ _PyPegen_function_def_decorators(Parser *p, asdl_expr_seq *decorators, stmt_ty f
|
|||
assert(function_def != NULL);
|
||||
if (function_def->kind == AsyncFunctionDef_kind) {
|
||||
return _PyAST_AsyncFunctionDef(
|
||||
function_def->v.FunctionDef.name, function_def->v.FunctionDef.type_params,
|
||||
function_def->v.FunctionDef.args,
|
||||
function_def->v.FunctionDef.body, decorators, function_def->v.FunctionDef.returns,
|
||||
function_def->v.FunctionDef.type_comment, function_def->lineno,
|
||||
function_def->col_offset, function_def->end_lineno, function_def->end_col_offset,
|
||||
p->arena);
|
||||
function_def->v.AsyncFunctionDef.name,
|
||||
function_def->v.AsyncFunctionDef.args,
|
||||
function_def->v.AsyncFunctionDef.body, decorators,
|
||||
function_def->v.AsyncFunctionDef.returns,
|
||||
function_def->v.AsyncFunctionDef.type_comment,
|
||||
function_def->v.AsyncFunctionDef.type_params,
|
||||
function_def->lineno, function_def->col_offset,
|
||||
function_def->end_lineno, function_def->end_col_offset, p->arena);
|
||||
}
|
||||
|
||||
return _PyAST_FunctionDef(
|
||||
function_def->v.FunctionDef.name, function_def->v.FunctionDef.type_params,
|
||||
function_def->v.FunctionDef.name,
|
||||
function_def->v.FunctionDef.args,
|
||||
function_def->v.FunctionDef.body, decorators,
|
||||
function_def->v.FunctionDef.returns,
|
||||
function_def->v.FunctionDef.type_comment, function_def->lineno,
|
||||
function_def->col_offset, function_def->end_lineno,
|
||||
function_def->end_col_offset, p->arena);
|
||||
function_def->v.FunctionDef.type_comment,
|
||||
function_def->v.FunctionDef.type_params,
|
||||
function_def->lineno, function_def->col_offset,
|
||||
function_def->end_lineno, function_def->end_col_offset, p->arena);
|
||||
}
|
||||
|
||||
/* Construct a ClassDef equivalent to class_def, but with decorators */
|
||||
|
@ -776,9 +779,10 @@ _PyPegen_class_def_decorators(Parser *p, asdl_expr_seq *decorators, stmt_ty clas
|
|||
{
|
||||
assert(class_def != NULL);
|
||||
return _PyAST_ClassDef(
|
||||
class_def->v.ClassDef.name, class_def->v.ClassDef.type_params,
|
||||
class_def->v.ClassDef.name,
|
||||
class_def->v.ClassDef.bases, class_def->v.ClassDef.keywords,
|
||||
class_def->v.ClassDef.body, decorators,
|
||||
class_def->v.ClassDef.type_params,
|
||||
class_def->lineno, class_def->col_offset, class_def->end_lineno,
|
||||
class_def->end_col_offset, p->arena);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue