Skip to content

Commit 2894653

Browse files
committed
Rust: Query for missing elements.
1 parent c7be2ae commit 2894653

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* @name Missing Elements
3+
* @description List all elements that weren't extracted due to unimplemented features or parse errors.
4+
* @kind diagnostic
5+
* @id rust/diagnostics/missing-elements
6+
*/
7+
8+
import rust
9+
10+
query predicate listUnimplemented(AstNode n, string msg) {
11+
// not extracted yet
12+
n instanceof Unimplemented and
13+
msg = "Not yet implemented."
14+
}
15+
16+
query predicate listMissingExpr(Expr e, string msg) {
17+
// gaps in the AST due to parse errors
18+
e instanceof MissingExpr and
19+
msg = "Missing expression."
20+
}
21+
22+
query predicate listMissingPat(Pat p, string msg) {
23+
// gaps in the AST due to parse errors
24+
p instanceof MissingPat and
25+
msg = "Missing pattern."
26+
}

0 commit comments

Comments
 (0)