@@ -3305,32 +3305,32 @@ compiler_async_for(struct compiler *c, stmt_ty s)
3305
3305
if (IS_TOP_LEVEL_AWAIT (c )){
3306
3306
c -> u -> u_ste -> ste_coroutine = 1 ;
3307
3307
} else if (c -> u -> u_scope_type != COMPILER_SCOPE_ASYNC_FUNCTION ) {
3308
- return compiler_error (c , loc , "'async for' outside async function" );
3308
+ compiler_error (c , loc , "'async for' outside async function" );
3309
+ return ERROR ;
3309
3310
}
3310
3311
3311
3312
NEW_JUMP_TARGET_LABEL (c , start );
3312
3313
NEW_JUMP_TARGET_LABEL (c , except );
3313
3314
NEW_JUMP_TARGET_LABEL (c , end );
3314
3315
3315
- _VISIT (c , expr , s -> v .AsyncFor .iter );
3316
- _ADDOP (c , loc , GET_AITER );
3316
+ VISIT (c , expr , s -> v .AsyncFor .iter );
3317
+ ADDOP (c , loc , GET_AITER );
3317
3318
3318
3319
USE_LABEL (c , start );
3319
- if (compiler_push_fblock (c , loc , FOR_LOOP , start , end , NULL ) < 0 ) {
3320
- return 0 ;
3321
- }
3320
+ RETURN_IF_ERROR (compiler_push_fblock (c , loc , FOR_LOOP , start , end , NULL ));
3321
+
3322
3322
/* SETUP_FINALLY to guard the __anext__ call */
<
8000
td data-grid-cell-id="diff-ebc983d9f91e5bcf73500e377ac65e85863c4f77fd5b6b6caf4fcdf7c0f0b057-3323-3322-0" data-selected="false" role="gridcell" style="background-color:var(--diffBlob-deletionNum-bgColor, var(--diffBlob-deletion-bgColor-num));text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative left-side">3323
- _ADDOP_JUMP (c , loc , SETUP_FINALLY , except );
3324
- _ADDOP (c , loc , GET_ANEXT );
3325
- _ADDOP_LOAD_CONST (c , loc , Py_None );
3326
- _ADD_YIELD_FROM (c , loc , 1 );
3327
- _ADDOP (c , loc , POP_BLOCK ); /* for SETUP_FINALLY */
3323
+ ADDOP_JUMP (c , loc , SETUP_FINALLY , except );
3324
+ ADDOP (c , loc , GET_ANEXT );
3325
+ ADDOP_LOAD_CONST (c , loc , Py_None );
3326
+ ADD_YIELD_FROM (c , loc , 1 );
3327
+ ADDOP (c , loc , POP_BLOCK ); /* for SETUP_FINALLY */
3328
3328
3329
3329
/* Success block for __anext__ */
3330
- _VISIT (c , expr , s -> v .AsyncFor .target );
3331
- _VISIT_SEQ (c , stmt , s -> v .AsyncFor .body );
3330
+ VISIT (c , expr , s -> v .AsyncFor .target );
3331
+ VISIT_SEQ (c , stmt , s -> v .AsyncFor .body );
3332
3332
/* Mark jump as artificial */
3333
- _ADDOP_JUMP (c , NO_LOCATION , JUMP , start );
3333
+ ADDOP_JUMP (c , NO_LOCATION , JUMP , start );
3334
3334
3335
3335
compiler_pop_fblock (c , FOR_LOOP , start );
3336
3336
@@ -3340,13 +3340,13 @@ compiler_async_for(struct compiler *c, stmt_ty s)
3340
3340
/* Use same line number as the iterator,
3341
3341
* as the END_ASYNC_FOR succeeds the `for`, not the body. */
3342
3342
loc = LOC (s -> v .AsyncFor .iter );
3343
- _ADDOP (c , loc , END_ASYNC_FOR );
3343
+ ADDOP (c , loc , END_ASYNC_FOR );
3344
3344
3345
3345
/* `else` block */
3346
- _VISIT_SEQ (c , stmt , s -> v .For .orelse );
3346
+ VISIT_SEQ (c , stmt , s -> v .For .orelse );
3347
3347
3348
3348
USE_LABEL (c , end );
3349
- return 1 ;
3349
+ return SUCCESS ;
3350
3350
}
3351
3351
3352
3352
static int
@@ -4177,20 +4177,20 @@ static int
4177
4177
compiler_stmt_expr (struct compiler * c , location loc , expr_ty value )
4178
4178
{
4179
4179
if (c -> c_interactive && c -> c_nestlevel <= 1 ) {
4180
- _VISIT (c , expr , value );
4181
- _ADDOP (c , loc , PRINT_EXPR );
4182
- return 1 ;
4180
+ VISIT (c , expr , value );
4181
+ ADDOP (c , loc , PRINT_EXPR );
4182
+ return SUCCESS ;
4183
4183
}
4184
4184
4185
4185
if (value -> kind == Constant_kind ) {
4186
4186
/* ignore constant statement */
4187
- _ADDOP (c , loc , NOP );
4188
- return 1 ;
4187
+ ADDOP (c , loc , NOP );
4188
+ return SUCCESS ;
4189
4189
}
4190
4190
4191
- _VISIT (c , expr , value );
4192
- _ADDOP (c , NO_LOCATION , POP_TOP ); /* artificial */
4193
- return 1 ;
4191
+ VISIT (c , expr , value );
4192
+ ADDOP (c , NO_LOCATION , POP_TOP ); /* artificial */
4193
+ return SUCCESS ;
4194
4194
}
4195
4195
4196
4196
static int
@@ -4261,7 +4261,7 @@ compiler_visit_stmt(struct compiler *c, stmt_ty s)
4261
4261
break ;
4262
4262
case Expr_kind :
4263
4263
{
4264
- return compiler_stmt_expr (c , LOC (s ), s -> v .Expr .value );
4264
+ return compiler_stmt_expr (c , LOC (s ), s -> v .Expr .value ) == SUCCESS ? 1 : 0 ;
4265
4265
}
4266
4266
case Pass_kind :
4267
4267
{
@@ -4283,7 +4283,7 @@ compiler_visit_stmt(struct compiler *c, stmt_ty s)
4283
4283
case AsyncWith_kind :
4284
4284
return compiler_async_with (c , s , 0 ) == SUCCESS ? 1 : 0 ;
4285
4285
case AsyncFor_kind :
4286
- return compiler_async_for (c , s );
4286
+ return compiler_async_for (c , s ) == SUCCESS ? 1 : 0 ;
4287
4287
}
4288
4288
4289
4289
return 1 ;
0 commit comments