8000 Get rid of ERROR_IF's "label" parameter (GH-132654) · python/cpython@732d1b0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 732d1b0

Browse files
authored
Get rid of ERROR_IF's "label" parameter (GH-132654)
1 parent b329096 commit 732d1b0

File tree

7 files changed

+155
-162
lines changed

7 files changed

+155
-162
lines changed

Lib/test/test_generated_cases.py

Lines changed: 17 additions & 17 deletions
1431
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ def test_pep7_condition(self):
419419
def test_error_if_plain(self):
420420
input = """
421421
inst(OP, (--)) {
422-
ERROR_IF(cond, label);
422+
ERROR_IF(cond);
423423
}
424424
"""
425425
output = """
@@ -432,7 +432,7 @@ def test_error_if_plain(self):
432432
next_instr += 1;
433433
INSTRUCTION_STATS(OP);
434434
if (cond) {
435-
JUMP_TO_LABEL(label);
435+
JUMP_TO_LABEL(error);
436436
}
437437
DISPATCH();
438438
}
@@ -442,7 +442,7 @@ def test_error_if_plain(self):
442442
def test_error_if_plain_with_comment(self):
443443
input = """
444444
inst(OP, (--)) {
445-
ERROR_IF(cond, label); // Comment is ok
445+
ERROR_IF(cond); // Comment is ok
446446
}
447447
"""
448448
output = """
@@ -455,7 +455,7 @@ def test_error_if_plain_with_comment(self):
455455
next_instr += 1;
456456
INSTRUCTION_STATS(OP);
457457
if (cond) {
458-
JUMP_TO_LABEL(label);
458+
JUMP_TO_LABEL(error);
459459
}
460460
DISPATCH();
461461
}
@@ -467,7 +467,7 @@ def test_error_if_pop(self):
467467
inst(OP, (left, right -- res)) {
468468
SPAM(left, right);
469469
INPUTS_DEAD();
470-
ERROR_IF(cond, label);
470+
ERROR_IF(cond);
471471
res = 0;
472472
}
473473
"""
@@ -487,7 +487,7 @@ def test_error_if_pop(self):
487487
left = stack_pointer[-2];
488488
SPAM(left, right);
489489
if (cond) {
490-
JUMP_TO_LABEL(pop_2_label);
490+
JUMP_TO_LABEL(pop_2_error);
491491
}
492492
res = 0;
493493
stack_pointer[-2] = res;
@@ -503,7 +503,7 @@ def test_error_if_pop_with_result(self):
503503
inst(OP, (left, right -- res)) {
504504
res = SPAM(left, right);
505505
INPUTS_DEAD();
506-
ERROR_IF(cond, label);
506+
ERROR_IF(cond);
507507
}
508508
"""
509509
output = """
@@ -522,7 +522,7 @@ def test_error_if_pop_with_result(self):
522522
left = stack_pointer[-2];
523523
res = SPAM(left, right);
524524
if (cond) {
525-
JUMP_TO_LABEL(pop_2_label);
525+
JUMP_TO_LABEL(pop_2_error);
526526
}
527527
stack_pointer[-2] = res;
528528
stack_pointer += -1;
@@ -903,7 +903,7 @@ def test_array_error_if(self):
903903
inst(OP, (extra, values[oparg] --)) {
904904
DEAD(extra);
905905
DEAD(values);
906-
ERROR_IF(oparg == 0, somewhere);
906+
ERROR_IF(oparg == 0);
907907
}
908908
"""
909909
output = """
@@ -922,7 +922,7 @@ def test_array_error_if(self):
922922
if (oparg == 0) {
923923
stack_pointer += -1 - oparg;
924924
assert(WITHIN_STACK_BOUNDS());
925-
JUMP_TO_LABEL(somewhere);
925+
JUMP_TO_LABEL(error);
926926
}
927927
stack_pointer += -1 - oparg;
928928
assert(WITHIN_STACK_BOUNDS());
@@ -1319,7 +1319,7 @@ def test_pop_on_error_peeks(self):
13191319
13201320
op(THIRD, (j, k --)) {
13211321
INPUTS_DEAD(); // Mark j and k as used
1322-
ERROR_IF(cond, error);
1322+
ERROR_IF(cond);
13231323
}
13241324
13251325
macro(TEST) = FIRST + SECOND + THIRD;
@@ -1369,7 +1369,7 @@ def test_push_then_error(self):
13691369
13701370
op(SECOND, (a -- a, b)) {
13711371
b = 1;
1372-
ERROR_IF(cond, error);
1372+
ERROR_IF(cond);
13731373
}
13741374
13751375
macro(TEST) = FIRST + SECOND;
@@ -1414,10 +1414,10 @@ def test_error_if_true(self):
14141414

14151415
input = """
14161416
inst(OP1, ( --)) {
1417-
ERROR_IF(true, here);
1417+
ERROR_IF(true);
14181418
}
14191419
inst(OP2, ( --)) {
1420-
ERROR_IF(1, there);
1420+
ERROR_IF(1);
14211421
}
14221422
"""
14231423
output = """
@@ -1429,7 +1429,7 @@ def test_error_if_true(self):
14291429
frame->instr_ptr = next_instr;
14301430
next_instr += 1;
1431
INSTRUCTION_STATS(OP1);
1432-
JUMP_TO_LABEL(here);
1432+
JUMP_TO_LABEL(error);
14331433
}
14341434
14351435
TARGET(OP2) {
@@ -1440,7 +1440,7 @@ def test_error_if_true(self):
14401440
frame->instr_ptr = next_instr;
14411441
next_instr += 1;
14421442
INSTRUCTION_STATS(OP2);
1443-
JUMP_TO_LABEL(there);
1443+
JUMP_TO_LABEL(error);
14441444
}
14451445
"""
14461446
self.run_cases_test(input, output)
@@ -1716,7 +1716,7 @@ def test_no_escaping_calls_in_branching_macros(self):
17161716

17171717
input = """
17181718
inst(OP, ( -- )) {
1719-
ERROR_IF(escaping_call(), error);
1719+
ERROR_IF(escaping_call());
17201720
}
17211721
"""
17221722
with self.assertRaises(SyntaxError):

0 commit comments

Comments
 (0)
0