Skip to content

Commit 61c728b

Browse files
committed
Rust: drop AssocItem and ExternItem classes
1 parent 438b92b commit 61c728b

38 files changed

+314
-723
lines changed

rust/ast-generator/src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ fn class_name(type_name: &str) -> String {
2424
"ArrayExpr" => "ArrayExprInternal".to_owned(),
2525
"AsmOptions" => "AsmOptionsList".to_owned(),
2626
"MacroStmts" => "MacroBlockExpr".to_owned(),
27+
"AssocItem" => "Item".to_owned(),
28+
"ExternItem" => "Item".to_owned(),
2729
_ if type_name.starts_with("Record") => type_name.replacen("Record", "Struct", 1),
2830
_ if type_name.ends_with("Type") => format!("{}Repr", type_name),
2931
_ => type_name.to_owned(),
@@ -88,7 +90,7 @@ struct Schema {
8890
fn get_bases(name: &str, super_types: &BTreeMap<String, BTreeSet<String>>) -> Vec<String> {
8991
super_types
9092
.get(name)
91-
.map(|tys| tys.iter().map(|t| class_name(t)).collect())
93+
.map(|tys| tys.iter().map(|t| class_name(t)).unique().collect())
9294
.unwrap_or_else(|| vec!["AstNode".to_string()])
9395
}
9496

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)