Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/syntax/src/tests/sourcegen_ast.rs')
| -rw-r--r-- | crates/syntax/src/tests/sourcegen_ast.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/crates/syntax/src/tests/sourcegen_ast.rs b/crates/syntax/src/tests/sourcegen_ast.rs index 07213b08be..564cf6663c 100644 --- a/crates/syntax/src/tests/sourcegen_ast.rs +++ b/crates/syntax/src/tests/sourcegen_ast.rs @@ -209,7 +209,7 @@ fn generate_nodes(kinds: KindsSrc<'_>, grammar: &AstSrc) -> String { }) .unzip(); - let (dyn_node_defs, dyn_node_boilerplate_impls): (Vec<_>, Vec<_>) = grammar + let (any_node_defs, any_node_boilerplate_impls): (Vec<_>, Vec<_>) = grammar .nodes .iter() .flat_map(|node| node.traits.iter().map(move |t| (t, node))) @@ -217,7 +217,7 @@ fn generate_nodes(kinds: KindsSrc<'_>, grammar: &AstSrc) -> String { .into_iter() .sorted_by_key(|(k, _)| k.clone()) .map(|(trait_name, nodes)| { - let name = format_ident!("Dyn{}", trait_name); + let name = format_ident!("Any{}", trait_name); let trait_name = format_ident!("{}", trait_name); let kinds: Vec<_> = nodes .iter() @@ -297,10 +297,10 @@ fn generate_nodes(kinds: KindsSrc<'_>, grammar: &AstSrc) -> String { #(#node_defs)* #(#enum_defs)* - #(#dyn_node_defs)* + #(#any_node_defs)* #(#node_boilerplate_impls)* #(#enum_boilerplate_impls)* - #(#dyn_node_boilerplate_impls)* + #(#any_node_boilerplate_impls)* #(#display_impls)* }; @@ -740,14 +740,14 @@ fn extract_enums(ast: &mut AstSrc) { fn extract_struct_traits(ast: &mut AstSrc) { let traits: &[(&str, &[&str])] = &[ - ("AttrsOwner", &["attrs"]), - ("NameOwner", &["name"]), - ("VisibilityOwner", &["visibility"]), - ("GenericParamsOwner", &["generic_param_list", "where_clause"]), - ("TypeBoundsOwner", &["type_bound_list", "colon_token"]), - ("ModuleItemOwner", &["items"]), - ("LoopBodyOwner", &["label", "loop_body"]), - ("ArgListOwner", &["arg_list"]), + ("HasAttrs", &["attrs"]), + ("HasName", &["name"]), + ("HasVisibility", &["visibility"]), + ("HasGenericParams", &["generic_param_list", "where_clause"]), + ("HasTypeBounds", &["type_bound_list", "colon_token"]), + ("HasModuleItem", &["items"]), + ("HasLoopBody", &["label", "loop_body"]), + ("HasArgList", &["arg_list"]), ]; for node in &mut ast.nodes { |