File tree Expand file tree Collapse file tree 2 files changed +16
-12
lines changed
python/downgrades/503c0516fba2e5da9570f00eb34ef43025ecb8fb Expand file tree Collapse file tree 2 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -23,15 +23,17 @@ class ExprParent_ extends @py_expr_parent {
23
23
* New kinds have been inserted such that
24
24
* `@py_Name` which used to have index 18 now has index 19.
25
25
* Entries with lower indices are unchanged.
26
+ *
27
+ * Note that if `18 <= new_index < 19`, it does not correspond
28
+ * to an old index.
26
29
*/
27
30
bindingset [ new_index]
28
31
int old_index ( int new_index ) {
29
- if new_index < 18
30
- then result = new_index
31
- else
32
- if new_index >= 19
33
- then result + ( 19 - 18 ) = new_index
34
- else none ( )
32
+ // before inserted range
33
+ new_index < 18 and result = new_index
34
+ or
35
+ // after inserted range
36
+ new_index >= 19 and result + ( 19 - 18 ) = new_index
35
37
}
36
38
37
39
// The schema for py_exprs is:
Original file line number Diff line number Diff line change @@ -23,15 +23,17 @@ class StmtList_ extends @py_stmt_list {
23
23
* New kinds have been inserted such that
24
24
* `@py_Nonlocal` which used to have index 14 now has index 16.
25
25
* Entries with lower indices are unchanged.
26
+ *
27
+ * Note that if `14 <= new_index < 16`, it does not correspond
28
+ * to an old index.
26
29
*/
27
30
bindingset [ new_index]
28
31
int old_index ( int new_index ) {
29
- if new_index < 14
30
- then result = new_index
31
- else
32
- if new_index >= 16
33
- then result + ( 16 - 14 ) = new_index
34
- else none ( )
32
+ // before inserted range
33
+ new_index < 14 and result = new_index
34
+ or
35
+ // after inserted range
36
+ new_index >= 16 and result + ( 16 - 14 ) = new_index
35
37
}
36
38
37
39
// The schema for py_stmts is:
You can’t perform that action at this time.
0 commit comments