Skip to content

Commit 14e6f9f

Browse files
committed
Remove @errorexpr from the dbscheme (use @badexpr)
1 parent 6023a12 commit 14e6f9f

File tree

9 files changed

+2220
-5
lines changed

9 files changed

+2220
-5
lines changed

go/downgrades/a58b81b1b4c4cccc8ca11731c1db86622f33af57/go.dbscheme

+547
Large diffs are not rendered by default.

go/downgrades/a58b81b1b4c4cccc8ca11731c1db86622f33af57/old.dbscheme

+546
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
description: Delete @errorexpr - @badexpr should be used instead
2+
compatibility: full

go/extractor/dbscheme/tables.go

-3
Original file line numberDiff line numberDiff line change
@@ -521,9 +521,6 @@ var ChanTypeExprs = map[ast.ChanDir]*BranchType{
521521
ast.SEND | ast.RECV: ExprKind.NewBranch("@sendrcvchantypeexpr", ChanTypeExpr),
522522
}
523523

524-
// ErrorExpr is an AST node type that is not used anywhere
525-
var ErrorExpr = ExprKind.NewBranch("@errorexpr")
526-
527524
// StmtKind is a case type for distinguishing different kinds of statement AST nodes
528525
var StmtKind = NewCaseType(StmtType, "kind")
529526

go/ql/lib/go.dbscheme

+1-2
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,7 @@ case @expr.kind of
319319
| 51 = @andnotexpr
320320
| 52 = @sendchantypeexpr
321321
| 53 = @recvchantypeexpr
322-
| 54 = @sendrcvchantypeexpr
323-
| 55 = @errorexpr;
322+
| 54 = @sendrcvchantypeexpr;
324323

325324
@basiclit = @intlit | @floatlit | @imaglit | @charlit | @stringlit;
326325

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
class Expr_ extends @expr {
2+
string toString() { result = "Expr" }
3+
}
4+
5+
class ExprParent_ extends @exprparent {
6+
string toString() { result = "ExprParent" }
7+
}
8+
9+
/**
10+
* The last index, 55 (errorexpr), has been deleted. Index 0 (badexpr) should
11+
* be used instead.
12+
*/
13+
bindingset[old_index]
14+
int new_index(int old_index) {
15+
if old_index = 55
16+
then result = 0 // badexpr
17+
else result = old_index
18+
}
19+
20+
// The schema for exprs is:
21+
//
22+
// exprs(unique int id: @expr,
23+
// int kind: int ref,
24+
// int parent: @exprparent ref,
25+
// int idx: int ref);
26+
from Expr_ expr, int new_kind, ExprParent_ parent, int idx, int old_kind
27+
where exprs(expr, old_kind, parent, idx) and new_kind = new_index(old_kind)
28+
select expr, new_kind, parent, idx

0 commit comments

Comments
 (0)