mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
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:
File diff suppressed because it is too large
Load Diff
@@ -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]
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,2 @@
|
||||
description: Add support for template string literals
|
||||
compatibility: backwards
|
||||
Reference in New Issue
Block a user