Skip to content

Commit bb26c31

Browse files
committed
Python: fix downgrade script
When new kinds are inserted, new indices exists that do not correspond to any old indices. These were previously mapped, now they are not.
1 parent c8f35ea commit bb26c31

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

python/downgrades/503c0516fba2e5da9570f00eb34ef43025ecb8fb/py_exprs.ql

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ class ExprParent_ extends @py_expr_parent {
2626
*/
2727
bindingset[new_index]
2828
int old_index(int new_index) {
29-
if new_index < 18 then result = new_index else result + (19 - 18) = 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()
3035
}
3136

3237
// The schema for py_exprs is:

python/downgrades/503c0516fba2e5da9570f00eb34ef43025ecb8fb/py_stmts.ql

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ class StmtList_ extends @py_stmt_list {
2626
*/
2727
bindingset[new_index]
2828
int old_index(int new_index) {
29-
if new_index < 14 then result = new_index else result + (16 - 14) = 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()
3035
}
3136

3237
// The schema for py_stmts is:

0 commit comments

Comments
 (0)