Skip to content

Commit 97bba11

Browse files
committed
C++: Add upgrade and downgrade script
1 parent 71c019e commit 97bba11

File tree

10 files changed

+8505
-0
lines changed

10 files changed

+8505
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
class Element extends @element {
2+
string toString() { none() }
3+
}
4+
5+
class Expr extends @expr {
6+
string toString() { none() }
7+
}
8+
9+
class Stmt extends @stmt {
10+
string toString() { none() }
11+
}
12+
13+
predicate isStmtWithInitializer(Stmt stmt) {
14+
exists(int kind | stmts(stmt, kind, _) | kind = 2 or kind = 11 or kind = 35)
15+
}
16+
17+
from Expr child, int index, int index_new, Element parent
18+
where
19+
exprparents(child, index, parent) and
20+
if isStmtWithInitializer(parent) then index_new = index - 1 else index_new = index
21+
select child, index_new, parent

0 commit comments

Comments
 (0)