diff options
author | Jelle Zijlstra <jelle.zijlstra@gmail.com> | 2023-05-26 12:54:37 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-26 12:54:37 (GMT) |
commit | ba73473f4c18ba4cf7ab18d84d94a47d2d37a0c5 (patch) | |
tree | 64dd261a14ec8991182807c5a01f8042c5fb6f1f /Parser/action_helpers.c | |
parent | 6e1eccdcce5ea3bf1ef9d326d20ef9df21262c6b (diff) | |
download | cpython-ba73473f4c18ba4cf7ab18d84d94a47d2d37a0c5.zip cpython-ba73473f4c18ba4cf7ab18d84d94a47d2d37a0c5.tar.gz cpython-ba73473f4c18ba4cf7ab18d84d94a47d2d37a0c5.tar.bz2 |
gh-104799: Move location of type_params AST fields (#104828)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Diffstat (limited to 'Parser/action_helpers.c')
-rw-r--r-- | Parser/action_helpers.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/Parser/action_helpers.c b/Parser/action_helpers.c index 06d77b6..c4d8f75 100644 --- a/Parser/action_helpers.c +++ b/Parser/action_helpers.c @@ -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); } |