@@ -314,9 +314,9 @@ static int compiler_warn(struct compiler *, location loc, const char *, ...);
314
314
static int compiler_nameop (struct compiler * , location , identifier , expr_context_ty );
315
315
316
316
static PyCodeObject * compiler_mod (struct compiler * , mod_ty );
317
- static int compiler_visit_stmt (struct compiler * , stmt_ty );
318
- static int compiler_visit_keyword (struct compiler * , keyword_ty );
319
- static int compiler_visit_expr (struct compiler * , expr_ty );
317
+ static int codegen_visit_stmt (struct compiler * , stmt_ty );
318
+ static int codegen_visit_keyword (struct compiler * , keyword_ty );
319
+ static int codegen_visit_expr (struct compiler * , expr_ty );
320
320
static int codegen_augassign (struct compiler * , stmt_ty );
321
321
static int codegen_annassign (struct compiler * , stmt_ty );
322
322
static int codegen_subscript (struct compiler * , expr_ty );
@@ -1037,17 +1037,17 @@ codegen_addop_j(instr_sequence *seq, location loc,
1037
1037
*/
1038
1038
1039
1039
#define VISIT (C , TYPE , V ) \
1040
- RETURN_IF_ERROR(compiler_visit_ ## TYPE((C), (V)));
1040
+ RETURN_IF_ERROR(codegen_visit_ ## TYPE((C), (V)));
1041
1041
1042
1042
#define VISIT_IN_SCOPE (C , TYPE , V ) \
1043
- RETURN_IF_ERROR_IN_SCOPE((C), compiler_visit_ ## TYPE((C), (V)))
1043
+ RETURN_IF_ERROR_IN_SCOPE((C), codegen_visit_ ## TYPE((C), (V)))
1044
1044
1045
1045
#define VISIT_SEQ (C , TYPE , SEQ ) { \
1046
1046
int _i; \
1047
1047
asdl_ ## TYPE ## _seq *seq = (SEQ); /* avoid variable capture */ \
1048
1048
for (_i = 0; _i < asdl_seq_LEN(seq); _i++) { \
1049
1049
TYPE ## _ty elt = (TYPE ## _ty)asdl_seq_GET(seq, _i); \
1050
- RETURN_IF_ERROR(compiler_visit_ ## TYPE((C), elt)); \
1050
+ RETURN_IF_ERROR(codegen_visit_ ## TYPE((C), elt)); \
1051
1051
} \
1052
1052
}
1053
1053
@@ -1056,7 +1056,7 @@ codegen_addop_j(instr_sequence *seq, location loc,
1056
1056
asdl_ ## TYPE ## _seq *seq = (SEQ); /* avoid variable capture */ \
1057
1057
for (_i = 0; _i < asdl_seq_LEN(seq); _i++) { \
1058
1058
TYPE ## _ty elt = (TYPE ## _ty)asdl_seq_GET(seq, _i); \
1059
- if (compiler_visit_ ## TYPE((C), elt) < 0) { \
1059
+ if (codegen_visit_ ## TYPE((C), elt) < 0) { \
1060
1060
compiler_exit_scope(C); \
1061
1061
return ERROR; \
1062
1062
} \
@@ -1850,9 +1850,7 @@ codegen_kwonlydefaults(struct compiler *c, location loc,
1850
1850
goto error ;
1851
1851
}
1852
1852
ADDOP_LOAD_CONST_NEW (c , loc , mangled );
1853
- if (compiler_visit_expr (c , default_ ) < 0 ) {
1854
- goto error ;
1855
- }
1853
+ RETURN_IF_ERROR (codegen_visit_expr (c , default_ ));
1856
1854
}
1857
1855
}
1858
1856
if (default_count ) {
@@ -1869,7 +1867,7 @@ codegen_kwonlydefaults(struct compiler *c, location loc,
1869
1867
}
1870
1868
1871
1869
static int
1872
- compiler_visit_annexpr (struct compiler * c , expr_ty annotation )
1870
+ codegen_visit_annexpr (struct compiler * c , expr_ty annotation )
1873
1871
{
1874
1872
location loc = LOC (annotation );
1875
1873
ADDOP_LOAD_CONST_NEW (c , loc , _PyAST_ExprAsUnicode (annotation ));
@@ -3854,7 +3852,7 @@ codegen_stmt_expr(struct compiler *c, location loc, expr_ty value)
3854
3852
}
3855
3853
3856
3854
static int
3857
- compiler_visit_stmt (struct compiler * c , stmt_ty s )
3855
+ codegen_visit_stmt (struct compiler * c , stmt_ty s )
3858
3856
{
3859
3857
3860
3858
switch (s -> kind ) {
@@ -5807,7 +5805,7 @@ codegen_dictcomp(struct compiler *c, expr_ty e)
5807
5805
5808
5806
5809
5807
static int
5810
- compiler_visit_keyword (struct compiler * c , keyword_ty k )
5808
+ codegen_visit_keyword (struct compiler * c , keyword_ty k )
5811
5809
{
5812
5810
VISIT (c , expr , k -> value );
5813
5811
return SUCCESS ;
@@ -6035,7 +6033,7 @@ codegen_with(struct compiler *c, stmt_ty s, int pos)
6035
6033
}
6036
6034
6037
6035
static int
6038
- compiler_visit_expr (struct compiler * c , expr_ty e )
6036
+ codegen_visit_expr (struct compiler * c , expr_ty e )
6039
6037
{
6040
6038
location loc = LOC (e );
6041
6039
switch (e -> kind ) {
@@ -6955,9 +6953,7 @@ codegen_pattern_mapping(struct compiler *c, pattern_ty p,
6955
6953
compiler_error (c , LOC (p ), e );
6956
6954
goto error ;
6957
6955
}
6958
- if (compiler_visit_expr (c , key ) < 0 ) {
6959
- goto error ;
6960
- }
6956
+ RETURN_IF_ERROR (codegen_visit_expr (c , key ));
6961
6957
}
6962
6958
6963
6959
// all keys have been checked; there are no duplicates
0 commit comments