Skip to content

Commit

Permalink
Merge pull request #18107 from github/redsun82/rust-rename
Browse files Browse the repository at this point in the history
Rust: rename `MatchExpr.expr` to `scrutinee` in all layers
  • Loading branch information
redsun82 authored Nov 26, 2024
2 parents cb0ac61 + 7a86257 commit 9f09454
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions rust/ast-generator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ fn class_name(type_name: &str) -> String {
fn property_name(type_name: &str, field_name: &str) -> String {
let name = match (type_name, field_name) {
("Path", "segment") => "part",
("MatchExpr", "expr") => "scrutinee",
(_, "then_branch") => "then",
(_, "else_branch") => "else_",
_ => field_name,
Expand Down
2 changes: 1 addition & 1 deletion rust/extractor/src/generated/.generated.list

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions rust/extractor/src/generated/top.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions rust/extractor/src/translate/generated.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust/ql/.generated.list

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions rust/ql/lib/rust.dbscheme
Original file line number Diff line number Diff line change
Expand Up @@ -1896,9 +1896,9 @@ match_expr_attrs(
);

#keyset[id]
match_expr_exprs(
match_expr_scrutinees(
int id: @match_expr ref,
int expr: @expr ref
int scrutinee: @expr ref
);

#keyset[id]
Expand Down
2 changes: 1 addition & 1 deletion rust/schema/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ class _:
}
```
"""
expr: _ | ql.name("scrutinee") | doc("scrutinee (the expression being matched) of this match expression")
scrutinee: _ | doc("scrutinee (the expression being matched) of this match expression")


@annotate(ContinueExpr, cfg = True)
Expand Down
2 changes: 1 addition & 1 deletion rust/schema/ast.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9f09454

Please sign in to comment.