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 {
2323 * New kinds have been inserted such that
2424 * `@py_Name` which used to have index 18 now has index 19.
2525 * Entries with lower indices are unchanged.
26+ *
27+ * Note that if `18 <= new_index < 19`, it does not correspond
28+ * to an old index.
2629 */
2730bindingset [ new_index]
2831int 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
3537}
3638
3739// 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 {
2323 * New kinds have been inserted such that
2424 * `@py_Nonlocal` which used to have index 14 now has index 16.
2525 * Entries with lower indices are unchanged.
26+ *
27+ * Note that if `14 <= new_index < 16`, it does not correspond
28+ * to an old index.
2629 */
2730bindingset [ new_index]
2831int 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
3537}
3638
3739// The schema for py_stmts is:
You can’t perform that action at this time.
0 commit comments