Skip to content

Commit 8a01161

Browse files
author
Paolo Tranquilli
committed
Rust: rename MatchExpr.expr to scrutinee in all layers
This doesn't require `ql.name` and is simpler while we don't have to write upgrade scripts. The `ql.name` mechanism might get useful once we do have to write upgrade scripts, as that doesn't change the dbscheme.
1 parent 93e7202 commit 8a01161

File tree

9 files changed

+13
-12
lines changed

9 files changed

+13
-12
lines changed

rust/ast-generator/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ fn class_name(type_name: &String) -> String {
2828
fn property_name(type_name: &String, field_name: &String) -> String {
2929
match (type_name.as_str(), field_name.as_str()) {
3030
("Path", "segment") => "part".to_owned(),
31+
("MatchExpr", "expr") => "scrutinee".to_owned(),
3132
(_, "then_branch") => "then".to_owned(),
3233
(_, "else_branch") => "else_".to_owned(),
3334
_ => field_name.to_owned(),

rust/extractor/src/generated/.generated.list

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/extractor/src/generated/top.rs

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/extractor/src/translate/generated.rs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/ql/.generated.list

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/ql/lib/rust.dbscheme

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,9 +1896,9 @@ match_expr_attrs(
18961896
);
18971897

18981898
#keyset[id]
1899-
match_expr_exprs(
1899+
match_expr_scrutinees(
19001900
int id: @match_expr ref,
1901-
int expr: @expr ref
1901+
int scrutinee: @expr ref
19021902
);
19031903

19041904
#keyset[id]

rust/schema/annotations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ class _:
289289
}
290290
```
291291
"""
292-
expr: _ | ql.name("scrutinee") | doc("scrutinee (the expression being matched) of this match expression")
292+
scrutinee: _ | doc("scrutinee (the expression being matched) of this match expression")
293293

294294

295295
@annotate(ContinueExpr, cfg = True)

rust/schema/ast.py

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)