Python: Add up-/downgrade scripts for template literals

We do the usual thing. Downgrade scripts remove the relevant relations;
upgrade scripts do nothing.
This commit is contained in:
Taus
2025-12-04 15:09:21 +00:00
parent f709d02464
commit 44bf762817
7 changed files with 5113 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,21 @@
// We must wrap the DB types, as these cannot appear in argument lists
class Expr_ extends @py_expr {
string toString() { result = "Expr" }
}
class ExprParent_ extends @py_expr_parent {
string toString() { result = "ExprList" }
}
query predicate py_exprs_without_template_strings(Expr_ id, int kind, ExprParent_ parent, int idx) {
py_exprs(id, kind, parent, idx) and
// From the dbscheme:
//
// case @py_expr.kind of
// ...
// | 39 = @py_SpecialOperation
// | 40 = @py_TemplateString
// | 41 = @py_JoinedTemplateString
// | 42 = @py_TemplateStringPart;
not kind in [40, 41, 42]
}

View File

@@ -0,0 +1,4 @@
description: Remove support for template string literals
compatibility: backwards
py_TemplateString_lists.rel: delete
py_exprs.rel: run py_exprs.qlo py_exprs_without_template_strings

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
description: Add support for template string literals
compatibility: backwards