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.
This commit is contained in:
Rasmus Lerchedahl Petersen
2023-01-05 14:56:52 +01:00
parent c8f35ea1ea
commit bb26c31f84
2 changed files with 12 additions and 2 deletions

View File

@@ -26,7 +26,12 @@ class ExprParent_ extends @py_expr_parent {
*/
bindingset[new_index]
int old_index(int new_index) {
if new_index < 18 then result = new_index else result + (19 - 18) = new_index
if new_index < 18
then result = new_index
else
if new_index >= 19
then result + (19 - 18) = new_index
else none()
}
// The schema for py_exprs is:

View File

@@ -26,7 +26,12 @@ class StmtList_ extends @py_stmt_list {
*/
bindingset[new_index]
int old_index(int new_index) {
if new_index < 14 then result = new_index else result + (16 - 14) = new_index
if new_index < 14
then result = new_index
else
if new_index >= 16
then result + (16 - 14) = new_index
else none()
}
// The schema for py_stmts is: