summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorJelle Zijlstra <jelle.zijlstra@gmail.com>2023-05-22 04:25:09 (GMT)
committerGitHub <noreply@github.com>2023-05-22 04:25:09 (GMT)
commita5f244d627a6815cf2d8ccec836b9b52eb3e8de2 (patch)
tree55b68f8a6f9366132742fb45bd93199065f9e720 /Include
parentef5d00a59207a63c6d5ae0d5d44054847d1bf3b5 (diff)
downloadcpython-a5f244d627a6815cf2d8ccec836b9b52eb3e8de2.zip
cpython-a5f244d627a6815cf2d8ccec836b9b52eb3e8de2.tar.gz
cpython-a5f244d627a6815cf2d8ccec836b9b52eb3e8de2.tar.bz2
gh-104656: Rename typeparams AST node to type_params (#104657)
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_ast.h53
-rw-r--r--Include/internal/pycore_ast_state.h4
2 files changed, 29 insertions, 28 deletions
diff --git a/Include/internal/pycore_ast.h b/Include/internal/pycore_ast.h
index 9f1cef0..06a4023 100644
--- a/Include/internal/pycore_ast.h
+++ b/Include/internal/pycore_ast.h
@@ -51,7 +51,7 @@ typedef struct _pattern *pattern_ty;
typedef struct _type_ignore *type_ignore_ty;
-typedef struct _typeparam *typeparam_ty;
+typedef struct _type_param *type_param_ty;
typedef struct {
@@ -151,10 +151,11 @@ asdl_type_ignore_seq *_Py_asdl_type_ignore_seq_new(Py_ssize_t size, PyArena
typedef struct {
_ASDL_SEQ_HEAD
- typeparam_ty typed_elements[1];
-} asdl_typeparam_seq;
+ type_param_ty typed_elements[1];
+} asdl_type_param_seq;
-asdl_typeparam_seq *_Py_asdl_typeparam_seq_new(Py_ssize_t size, PyArena *arena);
+asdl_type_param_seq *_Py_asdl_type_param_seq_new(Py_ssize_t size, PyArena
+ *arena);
enum _mod_kind {Module_kind=1, Interactive_kind=2, Expression_kind=3,
@@ -197,7 +198,7 @@ struct _stmt {
union {
struct {
identifier name;
- asdl_typeparam_seq *typeparams;
+ asdl_type_param_seq *type_params;
arguments_ty args;
asdl_stmt_seq *body;
asdl_expr_seq *decorator_list;
@@ -207,7 +208,7 @@ struct _stmt {
struct {
identifier name;
- asdl_typeparam_seq *typeparams;
+ asdl_type_param_seq *type_params;
arguments_ty args;
asdl_stmt_seq *body;
asdl_expr_seq *decorator_list;
@@ -217,7 +218,7 @@ struct _stmt {
struct {
identifier name;
- asdl_typeparam_seq *typeparams;
+ asdl_type_param_seq *type_params;
asdl_expr_seq *bases;
asdl_keyword_seq *keywords;
asdl_stmt_seq *body;
@@ -240,7 +241,7 @@ struct _stmt {
struct {
expr_ty name;
- asdl_typeparam_seq *typeparams;
+ asdl_type_param_seq *type_params;
expr_ty value;
} TypeAlias;
@@ -649,9 +650,9 @@ struct _type_ignore {
} v;
};
-enum _typeparam_kind {TypeVar_kind=1, ParamSpec_kind=2, TypeVarTuple_kind=3};
-struct _typeparam {
- enum _typeparam_kind kind;
+enum _type_param_kind {TypeVar_kind=1, ParamSpec_kind=2, TypeVarTuple_kind=3};
+struct _type_param {
+ enum _type_param_kind kind;
union {
struct {
identifier name;
@@ -681,18 +682,18 @@ mod_ty _PyAST_Interactive(asdl_stmt_seq * body, PyArena *arena);
mod_ty _PyAST_Expression(expr_ty body, PyArena *arena);
mod_ty _PyAST_FunctionType(asdl_expr_seq * argtypes, expr_ty returns, PyArena
*arena);
-stmt_ty _PyAST_FunctionDef(identifier name, asdl_typeparam_seq * typeparams,
+stmt_ty _PyAST_FunctionDef(identifier name, asdl_type_param_seq * type_params,
arguments_ty args, asdl_stmt_seq * body,
asdl_expr_seq * decorator_list, expr_ty returns,
string type_comment, int lineno, int col_offset, int
end_lineno, int end_col_offset, PyArena *arena);
-stmt_ty _PyAST_AsyncFunctionDef(identifier name, asdl_typeparam_seq *
- typeparams, arguments_ty args, asdl_stmt_seq *
+stmt_ty _PyAST_AsyncFunctionDef(identifier name, asdl_type_param_seq *
+ type_params, arguments_ty args, asdl_stmt_seq *
body, asdl_expr_seq * decorator_list, expr_ty
returns, string type_comment, int lineno, int
col_offset, int end_lineno, int end_col_offset,
PyArena *arena);
-stmt_ty _PyAST_ClassDef(identifier name, asdl_typeparam_seq * typeparams,
+stmt_ty _PyAST_ClassDef(identifier name, asdl_type_param_seq * type_params,
asdl_expr_seq * bases, asdl_keyword_seq * keywords,
asdl_stmt_seq * body, asdl_expr_seq * decorator_list,
int lineno, int col_offset, int end_lineno, int
@@ -704,9 +705,9 @@ stmt_ty _PyAST_Delete(asdl_expr_seq * targets, int lineno, int col_offset, int
stmt_ty _PyAST_Assign(asdl_expr_seq * targets, expr_ty value, string
type_comment, int lineno, int col_offset, int end_lineno,
int end_col_offset, PyArena *arena);
-stmt_ty _PyAST_TypeAlias(expr_ty name, asdl_typeparam_seq * typeparams, expr_ty
- value, int lineno, int col_offset, int end_lineno, int
- end_col_offset, PyArena *arena);
+stmt_ty _PyAST_TypeAlias(expr_ty name, asdl_type_param_seq * type_params,
+ expr_ty value, int lineno, int col_offset, int
+ end_lineno, int end_col_offset, PyArena *arena);
stmt_ty _PyAST_AugAssign(expr_ty target, operator_ty op, expr_ty value, int
lineno, int col_offset, int end_lineno, int
end_col_offset, PyArena *arena);
@@ -891,14 +892,14 @@ pattern_ty _PyAST_MatchOr(asdl_pattern_seq * patterns, int lineno, int
col_offset, int end_lineno, int end_col_offset,
PyArena *arena);
type_ignore_ty _PyAST_TypeIgnore(int lineno, string tag, PyArena *arena);
-typeparam_ty _PyAST_TypeVar(identifier name, expr_ty bound, int lineno, int
- col_offset, int end_lineno, int end_col_offset,
- PyArena *arena);
-typeparam_ty _PyAST_ParamSpec(identifier name, int lineno, int col_offset, int
- end_lineno, int end_col_offset, PyArena *arena);
-typeparam_ty _PyAST_TypeVarTuple(identifier name, int lineno, int col_offset,
- int end_lineno, int end_col_offset, PyArena
- *arena);
+type_param_ty _PyAST_TypeVar(identifier name, expr_ty bound, int lineno, int
+ col_offset, int end_lineno, int end_col_offset,
+ PyArena *arena);
+type_param_ty _PyAST_ParamSpec(identifier name, int lineno, int col_offset, int
+ end_lineno, int end_col_offset, PyArena *arena);
+type_param_ty _PyAST_TypeVarTuple(identifier name, int lineno, int col_offset,
+ int end_lineno, int end_col_offset, PyArena
+ *arena);
PyObject* PyAST_mod2obj(mod_ty t);
diff --git a/Include/internal/pycore_ast_state.h b/Include/internal/pycore_ast_state.h
index e723ead5..0c0d53f 100644
--- a/Include/internal/pycore_ast_state.h
+++ b/Include/internal/pycore_ast_state.h
@@ -248,8 +248,8 @@ struct ast_state {
PyObject *type_comment;
PyObject *type_ignore_type;
PyObject *type_ignores;
- PyObject *typeparam_type;
- PyObject *typeparams;
+ PyObject *type_param_type;
+ PyObject *type_params;
PyObject *unaryop_type;
PyObject *upper;
PyObject *value;