Skip to content

Commit e7ffddd

Browse files
author
Paolo Tranquilli
committed
Rust: rename all *Type to *TypeRef
1 parent 99bd75c commit e7ffddd

File tree

213 files changed

+2058
-2027
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

213 files changed

+2058
-2027
lines changed

rust/ast-generator/src/main.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@ fn project_root() -> PathBuf {
1515
}
1616

1717
fn class_name(type_name: &str) -> String {
18-
let name = match type_name {
19-
"BinExpr" => "BinaryExpr",
20-
"ElseBranch" => "Expr",
21-
"Fn" => "Function",
22-
"Literal" => "LiteralExpr",
23-
"Type" => "TypeRef",
24-
_ => type_name,
25-
};
26-
name.to_owned()
18+
match type_name {
19+
"BinExpr" => "BinaryExpr".to_owned(),
20+
"ElseBranch" => "Expr".to_owned(),
21+
"Fn" => "Function".to_owned(),
22+
"Literal" => "LiteralExpr".to_owned(),
23+
_ if type_name.ends_with("Type") => format!("{}Ref", type_name),
24+
_ => type_name.to_owned(),
25+
}
2726
}
2827

2928
fn property_name(type_name: &str, field_name: &str) -> String {

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.

0 commit comments

Comments
 (0)