Skip to content

Commit

Permalink
Merge pull request #18115 from paldepind/rust-rename-expr
Browse files Browse the repository at this point in the history
Rust: Rename `expr` on `CallExpr` and `LetExpr`
  • Loading branch information
paldepind authored Nov 27, 2024
2 parents 8f886c6 + 92427ab commit 46abb90
Show file tree
Hide file tree
Showing 30 changed files with 108 additions and 98 deletions.
4 changes: 3 additions & 1 deletion rust/ast-generator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ 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",
("CallExpr", "expr") => "function",
("LetExpr", "expr") => "scrutinee",
("MatchExpr", "expr") => "scrutinee",
("Path", "segment") => "part",
(_, "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.

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

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

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

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

18 changes: 9 additions & 9 deletions rust/ql/.generated.list

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/.gitattributes

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

Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ module ExprTrees {

class CallExprTree extends StandardPostOrderTree instanceof CallExpr {
override AstNode getChildNode(int i) {
i = 0 and result = super.getExpr()
i = 0 and result = super.getFunction()
or
result = super.getArgList().getArg(i - 1)
}
Expand Down Expand Up @@ -410,7 +410,7 @@ module ExprTrees {
class LetExprTree extends StandardPreOrderTree, LetExpr {
override AstNode getChildNode(int i) {
i = 0 and
result = this.getExpr()
result = this.getScrutinee()
or
i = 1 and
result = this.getPat()
Expand Down
Loading

0 comments on commit 46abb90

Please sign in to comment.