}
static int
-compiler_visit_kwonlydefaults(struct compiler *c, location loc,
+compiler_kwonlydefaults(struct compiler *c, location loc,
asdl_arg_seq *kwonlyargs, asdl_expr_seq *kw_defaults)
{
/* Push a dict of keyword-only default values.
}
static int
-compiler_visit_argannotation(struct compiler *c, identifier id,
+compiler_argannotation(struct compiler *c, identifier id,
expr_ty annotation, Py_ssize_t *annotations_len, location loc)
{
if (!annotation) {
}
static int
-compiler_visit_argannotations(struct compiler *c, asdl_arg_seq* args,
- Py_ssize_t *annotations_len, location loc)
+compiler_argannotations(struct compiler *c, asdl_arg_seq* args,
+ Py_ssize_t *annotations_len, location loc)
{
int i;
for (i = 0; i < asdl_seq_LEN(args); i++) {
arg_ty arg = (arg_ty)asdl_seq_GET(args, i);
RETURN_IF_ERROR(
- compiler_visit_argannotation(
+ compiler_argannotation(
c,
arg->arg,
arg->annotation,
}
static int
-compiler_visit_annotations_in_scope(struct compiler *c, location loc,
- arguments_ty args, expr_ty returns,
- Py_ssize_t *annotations_len)
+compiler_annotations_in_scope(struct compiler *c, location loc,
+ arguments_ty args, expr_ty returns,
+ Py_ssize_t *annotations_len)
{
RETURN_IF_ERROR(
- compiler_visit_argannotations(c, args->args, annotations_len, loc));
+ compiler_argannotations(c, args->args, annotations_len, loc));
RETURN_IF_ERROR(
- compiler_visit_argannotations(c, args->posonlyargs, annotations_len, loc));
+ compiler_argannotations(c, args->posonlyargs, annotations_len, loc));
if (args->vararg && args->vararg->annotation) {
RETURN_IF_ERROR(
- compiler_visit_argannotation(c, args->vararg->arg,
+ compiler_argannotation(c, args->vararg->arg,
args->vararg->annotation, annotations_len, loc));
}
RETURN_IF_ERROR(
- compiler_visit_argannotations(c, args->kwonlyargs, annotations_len, loc));
+ compiler_argannotations(c, args->kwonlyargs, annotations_len, loc));
if (args->kwarg && args->kwarg->annotation) {
RETURN_IF_ERROR(
- compiler_visit_argannotation(c, args->kwarg->arg,
+ compiler_argannotation(c, args->kwarg->arg,
args->kwarg->annotation, annotations_len, loc));
}
RETURN_IF_ERROR(
- compiler_visit_argannotation(c, &_Py_ID(return), returns, annotations_len, loc));
+ compiler_argannotation(c, &_Py_ID(return), returns, annotations_len, loc));
return 0;
}
static int
-compiler_visit_annotations(struct compiler *c, location loc,
+compiler_annotations(struct compiler *c, location loc,
arguments_ty args, expr_ty returns)
{
/* Push arg annotation names and values.
}
Py_DECREF(ste);
- if (compiler_visit_annotations_in_scope(c, loc, args, returns, &annotations_len) < 0) {
+ if (compiler_annotations_in_scope(c, loc, args, returns, &annotations_len) < 0) {
if (annotations_used) {
compiler_exit_scope(c);
}
}
static int
-compiler_visit_defaults(struct compiler *c, arguments_ty args,
+compiler_defaults(struct compiler *c, arguments_ty args,
location loc)
{
VISIT_SEQ(c, expr, args->defaults);
{
Py_ssize_t funcflags = 0;
if (args->defaults && asdl_seq_LEN(args->defaults) > 0) {
- RETURN_IF_ERROR(compiler_visit_defaults(c, args, loc));
+ RETURN_IF_ERROR(compiler_defaults(c, args, loc));
funcflags |= MAKE_FUNCTION_DEFAULTS;
}
if (args->kwonlyargs) {
- int res = compiler_visit_kwonlydefaults(c, loc,
- args->kwonlyargs,
- args->kw_defaults);
+ int res = compiler_kwonlydefaults(c, loc,
+ args->kwonlyargs,
+ args->kw_defaults);
RETURN_IF_ERROR(res);
if (res > 0) {
funcflags |= MAKE_FUNCTION_KWDEFAULTS;
}
}
- int annotations_flag = compiler_visit_annotations(c, loc, args, returns);
+ int annotations_flag = compiler_annotations(c, loc, args, returns);
if (annotations_flag < 0) {
if (is_generic) {
compiler_exit_scope(c);
}
static int
-compiler_visit_expr1(struct compiler *c, expr_ty e)
+compiler_visit_expr(struct compiler *c, expr_ty e)
{
location loc = LOC(e);
switch (e->kind) {
return SUCCESS;
}
-static int
-compiler_visit_expr(struct compiler *c, expr_ty e)
-{
- int res = compiler_visit_expr1(c, e);
- return res;
-}
-
static bool
is_two_element_slice(expr_ty s)
{