mirror of
https://github.com/github/codeql.git
synced 2026-08-05 01:43:23 +02:00
20 lines
510 B
Plaintext
20 lines
510 B
Plaintext
class Element extends @element {
|
|
string toString() { none() }
|
|
}
|
|
|
|
class Expr extends @expr {
|
|
string toString() { none() }
|
|
}
|
|
|
|
class Stmt extends @stmt {
|
|
string toString() { none() }
|
|
}
|
|
|
|
predicate isStmtWithInitializer(Stmt stmt) { exists(int kind | stmts(stmt, kind, _) | kind = 29) }
|
|
|
|
from Expr child, int index, int index_new, Element parent
|
|
where
|
|
exprparents(child, index, parent) and
|
|
if isStmtWithInitializer(parent) then index_new = index - 1 else index_new = index
|
|
select child, index_new, parent
|