diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-30 10:51:20 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-30 10:51:20 +0100 |
commit | 74864d560b9293174c82fdee2b9d15991ebf075f (patch) | |
tree | f76a250431629a36d225d456ed41f393aaa9a579 | |
parent | 72ffd851dd5b0fcdf3aa072131ba11009878b4ae (diff) | |
parent | 7d09e5ed618b9b9d6e00b57b24db0b9c8a8c12d7 (diff) |
Merge #5582
5582: Finish Module grammar r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
47 files changed, 172 insertions, 129 deletions
diff --git a/crates/ra_assists/src/handlers/add_missing_impl_members.rs b/crates/ra_assists/src/handlers/add_missing_impl_members.rs index f185e61e5..a2d9006e4 100644 --- a/crates/ra_assists/src/handlers/add_missing_impl_members.rs +++ b/crates/ra_assists/src/handlers/add_missing_impl_members.rs | |||
@@ -112,7 +112,7 @@ fn add_missing_impl_members_inner( | |||
112 | ) -> Option<()> { | 112 | ) -> Option<()> { |
113 | let _p = ra_prof::profile("add_missing_impl_members_inner"); | 113 | let _p = ra_prof::profile("add_missing_impl_members_inner"); |
114 | let impl_def = ctx.find_node_at_offset::<ast::ImplDef>()?; | 114 | let impl_def = ctx.find_node_at_offset::<ast::ImplDef>()?; |
115 | let impl_item_list = impl_def.item_list()?; | 115 | let impl_item_list = impl_def.assoc_item_list()?; |
116 | 116 | ||
117 | let trait_ = resolve_target_trait(&ctx.sema, &impl_def)?; | 117 | let trait_ = resolve_target_trait(&ctx.sema, &impl_def)?; |
118 | 118 | ||
@@ -121,6 +121,7 @@ fn add_missing_impl_members_inner( | |||
121 | ast::AssocItem::FnDef(def) => def.name(), | 121 | ast::AssocItem::FnDef(def) => def.name(), |
122 | ast::AssocItem::TypeAliasDef(def) => def.name(), | 122 | ast::AssocItem::TypeAliasDef(def) => def.name(), |
123 | ast::AssocItem::ConstDef(def) => def.name(), | 123 | ast::AssocItem::ConstDef(def) => def.name(), |
124 | ast::AssocItem::MacroCall(_) => None, | ||
124 | } | 125 | } |
125 | .map(|it| it.text().clone()) | 126 | .map(|it| it.text().clone()) |
126 | }; | 127 | }; |
diff --git a/crates/ra_assists/src/handlers/generate_new.rs b/crates/ra_assists/src/handlers/generate_new.rs index e27def1d8..25bc171bf 100644 --- a/crates/ra_assists/src/handlers/generate_new.rs +++ b/crates/ra_assists/src/handlers/generate_new.rs | |||
@@ -158,7 +158,7 @@ fn find_struct_impl(ctx: &AssistContext, strukt: &ast::StructDef) -> Option<Opti | |||
158 | } | 158 | } |
159 | 159 | ||
160 | fn has_new_fn(imp: &ast::ImplDef) -> bool { | 160 | fn has_new_fn(imp: &ast::ImplDef) -> bool { |
161 | if let Some(il) = imp.item_list() { | 161 | if let Some(il) = imp.assoc_item_list() { |
162 | for item in il.assoc_items() { | 162 | for item in il.assoc_items() { |
163 | if let ast::AssocItem::FnDef(f) = item { | 163 | if let ast::AssocItem::FnDef(f) = item { |
164 | if let Some(name) = f.name() { | 164 | if let Some(name) = f.name() { |
diff --git a/crates/ra_assists/src/handlers/move_bounds.rs b/crates/ra_assists/src/handlers/move_bounds.rs index ba3dafb99..6b73fff44 100644 --- a/crates/ra_assists/src/handlers/move_bounds.rs +++ b/crates/ra_assists/src/handlers/move_bounds.rs | |||
@@ -38,8 +38,8 @@ pub(crate) fn move_bounds_to_where_clause(acc: &mut Assists, ctx: &AssistContext | |||
38 | let anchor = match_ast! { | 38 | let anchor = match_ast! { |
39 | match parent { | 39 | match parent { |
40 | ast::FnDef(it) => it.body()?.syntax().clone().into(), | 40 | ast::FnDef(it) => it.body()?.syntax().clone().into(), |
41 | ast::TraitDef(it) => it.item_list()?.syntax().clone().into(), | 41 | ast::TraitDef(it) => it.assoc_item_list()?.syntax().clone().into(), |
42 | ast::ImplDef(it) => it.item_list()?.syntax().clone().into(), | 42 | ast::ImplDef(it) => it.assoc_item_list()?.syntax().clone().into(), |
43 | ast::EnumDef(it) => it.variant_list()?.syntax().clone().into(), | 43 | ast::EnumDef(it) => it.variant_list()?.syntax().clone().into(), |
44 | ast::StructDef(it) => { | 44 | ast::StructDef(it) => { |
45 | it.syntax().children_with_tokens() | 45 | it.syntax().children_with_tokens() |
diff --git a/crates/ra_assists/src/utils.rs b/crates/ra_assists/src/utils.rs index 02de902d6..27c33df23 100644 --- a/crates/ra_assists/src/utils.rs +++ b/crates/ra_assists/src/utils.rs | |||
@@ -63,7 +63,7 @@ pub fn get_missing_assoc_items( | |||
63 | let mut impl_fns_consts = FxHashSet::default(); | 63 | let mut impl_fns_consts = FxHashSet::default(); |
64 | let mut impl_type = FxHashSet::default(); | 64 | let mut impl_type = FxHashSet::default(); |
65 | 65 | ||
66 | if let Some(item_list) = impl_def.item_list() { | 66 | if let Some(item_list) = impl_def.assoc_item_list() { |
67 | for item in item_list.assoc_items() { | 67 | for item in item_list.assoc_items() { |
68 | match item { | 68 | match item { |
69 | ast::AssocItem::FnDef(f) => { | 69 | ast::AssocItem::FnDef(f) => { |
@@ -83,6 +83,7 @@ pub fn get_missing_assoc_items( | |||
83 | impl_fns_consts.insert(n.syntax().to_string()); | 83 | impl_fns_consts.insert(n.syntax().to_string()); |
84 | } | 84 | } |
85 | } | 85 | } |
86 | ast::AssocItem::MacroCall(_) => (), | ||
86 | } | 87 | } |
87 | } | 88 | } |
88 | } | 89 | } |
diff --git a/crates/ra_hir_def/src/item_tree/lower.rs b/crates/ra_hir_def/src/item_tree/lower.rs index eb1da4632..4fc21a642 100644 --- a/crates/ra_hir_def/src/item_tree/lower.rs +++ b/crates/ra_hir_def/src/item_tree/lower.rs | |||
@@ -153,13 +153,12 @@ impl Ctx { | |||
153 | self.forced_visibility = forced_vis; | 153 | self.forced_visibility = forced_vis; |
154 | } | 154 | } |
155 | 155 | ||
156 | fn lower_assoc_item(&mut self, item: &ast::Item) -> Option<AssocItem> { | 156 | fn lower_assoc_item(&mut self, item: &ast::AssocItem) -> Option<AssocItem> { |
157 | match item { | 157 | match item { |
158 | ast::Item::FnDef(ast) => self.lower_function(ast).map(Into::into), | 158 | ast::AssocItem::FnDef(ast) => self.lower_function(ast).map(Into::into), |
159 | ast::Item::TypeAliasDef(ast) => self.lower_type_alias(ast).map(Into::into), | 159 | ast::AssocItem::TypeAliasDef(ast) => self.lower_type_alias(ast).map(Into::into), |
160 | ast::Item::ConstDef(ast) => Some(self.lower_const(ast).into()), | 160 | ast::AssocItem::ConstDef(ast) => Some(self.lower_const(ast).into()), |
161 | ast::Item::MacroCall(ast) => self.lower_macro_call(ast).map(Into::into), | 161 | ast::AssocItem::MacroCall(ast) => self.lower_macro_call(ast).map(Into::into), |
162 | _ => None, | ||
163 | } | 162 | } |
164 | } | 163 | } |
165 | 164 | ||
@@ -419,9 +418,9 @@ impl Ctx { | |||
419 | let generic_params = | 418 | let generic_params = |
420 | self.lower_generic_params_and_inner_items(GenericsOwner::Trait(trait_def), trait_def); | 419 | self.lower_generic_params_and_inner_items(GenericsOwner::Trait(trait_def), trait_def); |
421 | let auto = trait_def.auto_token().is_some(); | 420 | let auto = trait_def.auto_token().is_some(); |
422 | let items = trait_def.item_list().map(|list| { | 421 | let items = trait_def.assoc_item_list().map(|list| { |
423 | self.with_inherited_visibility(visibility, |this| { | 422 | self.with_inherited_visibility(visibility, |this| { |
424 | list.items() | 423 | list.assoc_items() |
425 | .filter_map(|item| { | 424 | .filter_map(|item| { |
426 | let attrs = Attrs::new(&item, &this.hygiene); | 425 | let attrs = Attrs::new(&item, &this.hygiene); |
427 | this.collect_inner_items(item.syntax()); | 426 | this.collect_inner_items(item.syntax()); |
@@ -454,9 +453,9 @@ impl Ctx { | |||
454 | 453 | ||
455 | // We cannot use `assoc_items()` here as that does not include macro calls. | 454 | // We cannot use `assoc_items()` here as that does not include macro calls. |
456 | let items = impl_def | 455 | let items = impl_def |
457 | .item_list() | 456 | .assoc_item_list() |
458 | .into_iter() | 457 | .into_iter() |
459 | .flat_map(|it| it.items()) | 458 | .flat_map(|it| it.assoc_items()) |
460 | .filter_map(|item| { | 459 | .filter_map(|item| { |
461 | self.collect_inner_items(item.syntax()); | 460 | self.collect_inner_items(item.syntax()); |
462 | let assoc = self.lower_assoc_item(&item)?; | 461 | let assoc = self.lower_assoc_item(&item)?; |
diff --git a/crates/ra_ide/src/completion/complete_fn_param.rs b/crates/ra_ide/src/completion/complete_fn_param.rs index 7a53083f5..d4b6112a5 100644 --- a/crates/ra_ide/src/completion/complete_fn_param.rs +++ b/crates/ra_ide/src/completion/complete_fn_param.rs | |||
@@ -18,26 +18,36 @@ pub(super) fn complete_fn_param(acc: &mut Completions, ctx: &CompletionContext) | |||
18 | } | 18 | } |
19 | 19 | ||
20 | let mut params = FxHashMap::default(); | 20 | let mut params = FxHashMap::default(); |
21 | |||
21 | let me = ctx.token.ancestors().find_map(ast::FnDef::cast); | 22 | let me = ctx.token.ancestors().find_map(ast::FnDef::cast); |
23 | let mut process_fn = |func: ast::FnDef| { | ||
24 | if Some(&func) == me.as_ref() { | ||
25 | return; | ||
26 | } | ||
27 | func.param_list().into_iter().flat_map(|it| it.params()).for_each(|param| { | ||
28 | let text = param.syntax().text().to_string(); | ||
29 | params.entry(text).or_insert(param); | ||
30 | }) | ||
31 | }; | ||
32 | |||
22 | for node in ctx.token.parent().ancestors() { | 33 | for node in ctx.token.parent().ancestors() { |
23 | let items = match_ast! { | 34 | match_ast! { |
24 | match node { | 35 | match node { |
25 | ast::SourceFile(it) => it.items(), | 36 | ast::SourceFile(it) => it.items().filter_map(|item| match item { |
26 | ast::ItemList(it) => it.items(), | 37 | ast::Item::FnDef(it) => Some(it), |
38 | _ => None, | ||
39 | }).for_each(&mut process_fn), | ||
40 | ast::ItemList(it) => it.items().filter_map(|item| match item { | ||
41 | ast::Item::FnDef(it) => Some(it), | ||
42 | _ => None, | ||
43 | }).for_each(&mut process_fn), | ||
44 | ast::AssocItemList(it) => it.assoc_items().filter_map(|item| match item { | ||
45 | ast::AssocItem::FnDef(it) => Some(it), | ||
46 | _ => None, | ||
47 | }).for_each(&mut process_fn), | ||
27 | _ => continue, | 48 | _ => continue, |
28 | } | 49 | } |
29 | }; | 50 | }; |
30 | for item in items { | ||
31 | if let ast::Item::FnDef(func) = item { | ||
32 | if Some(&func) == me.as_ref() { | ||
33 | continue; | ||
34 | } | ||
35 | func.param_list().into_iter().flat_map(|it| it.params()).for_each(|param| { | ||
36 | let text = param.syntax().text().to_string(); | ||
37 | params.entry(text).or_insert(param); | ||
38 | }) | ||
39 | } | ||
40 | } | ||
41 | } | 51 | } |
42 | 52 | ||
43 | params | 53 | params |
diff --git a/crates/ra_ide/src/completion/complete_keyword.rs b/crates/ra_ide/src/completion/complete_keyword.rs index fcdaeef49..1581b2d5d 100644 --- a/crates/ra_ide/src/completion/complete_keyword.rs +++ b/crates/ra_ide/src/completion/complete_keyword.rs | |||
@@ -66,27 +66,24 @@ pub(super) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionConte | |||
66 | add_keyword(ctx, acc, "fn", "fn $0() {}") | 66 | add_keyword(ctx, acc, "fn", "fn $0() {}") |
67 | } | 67 | } |
68 | 68 | ||
69 | if (ctx.has_item_list_or_source_file_parent && !has_trait_or_impl_parent) | 69 | if (ctx.has_item_list_or_source_file_parent) || ctx.block_expr_parent { |
70 | || ctx.block_expr_parent | ||
71 | { | ||
72 | add_keyword(ctx, acc, "trait", "trait $0 {}"); | 70 | add_keyword(ctx, acc, "trait", "trait $0 {}"); |
73 | add_keyword(ctx, acc, "impl", "impl $0 {}"); | 71 | add_keyword(ctx, acc, "impl", "impl $0 {}"); |
74 | } | 72 | } |
75 | 73 | ||
76 | return; | 74 | return; |
77 | } | 75 | } |
78 | if ctx.has_item_list_or_source_file_parent || ctx.block_expr_parent { | 76 | if ctx.has_item_list_or_source_file_parent || has_trait_or_impl_parent || ctx.block_expr_parent |
77 | { | ||
79 | add_keyword(ctx, acc, "fn", "fn $0() {}"); | 78 | add_keyword(ctx, acc, "fn", "fn $0() {}"); |
80 | } | 79 | } |
81 | if (ctx.has_item_list_or_source_file_parent && !has_trait_or_impl_parent) | 80 | if (ctx.has_item_list_or_source_file_parent) || ctx.block_expr_parent { |
82 | || ctx.block_expr_parent | ||
83 | { | ||
84 | add_keyword(ctx, acc, "use", "use "); | 81 | add_keyword(ctx, acc, "use", "use "); |
85 | add_keyword(ctx, acc, "impl", "impl $0 {}"); | 82 | add_keyword(ctx, acc, "impl", "impl $0 {}"); |
86 | add_keyword(ctx, acc, "trait", "trait $0 {}"); | 83 | add_keyword(ctx, acc, "trait", "trait $0 {}"); |
87 | } | 84 | } |
88 | 85 | ||
89 | if ctx.has_item_list_or_source_file_parent && !has_trait_or_impl_parent { | 86 | if ctx.has_item_list_or_source_file_parent { |
90 | add_keyword(ctx, acc, "enum", "enum $0 {}"); | 87 | add_keyword(ctx, acc, "enum", "enum $0 {}"); |
91 | add_keyword(ctx, acc, "struct", "struct $0"); | 88 | add_keyword(ctx, acc, "struct", "struct $0"); |
92 | add_keyword(ctx, acc, "union", "union $0 {}"); | 89 | add_keyword(ctx, acc, "union", "union $0 {}"); |
@@ -108,29 +105,28 @@ pub(super) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionConte | |||
108 | add_keyword(ctx, acc, "else", "else {$0}"); | 105 | add_keyword(ctx, acc, "else", "else {$0}"); |
109 | add_keyword(ctx, acc, "else if", "else if $0 {}"); | 106 | add_keyword(ctx, acc, "else if", "else if $0 {}"); |
110 | } | 107 | } |
111 | if (ctx.has_item_list_or_source_file_parent && !has_trait_or_impl_parent) | 108 | if (ctx.has_item_list_or_source_file_parent) || ctx.block_expr_parent { |
112 | || ctx.block_expr_parent | ||
113 | { | ||
114 | add_keyword(ctx, acc, "mod", "mod $0 {}"); | 109 | add_keyword(ctx, acc, "mod", "mod $0 {}"); |
115 | } | 110 | } |
116 | if ctx.bind_pat_parent || ctx.ref_pat_parent { | 111 | if ctx.bind_pat_parent || ctx.ref_pat_parent { |
117 | add_keyword(ctx, acc, "mut", "mut "); | 112 | add_keyword(ctx, acc, "mut", "mut "); |
118 | } | 113 | } |
119 | if ctx.has_item_list_or_source_file_parent || ctx.block_expr_parent { | 114 | if ctx.has_item_list_or_source_file_parent || has_trait_or_impl_parent || ctx.block_expr_parent |
115 | { | ||
120 | add_keyword(ctx, acc, "const", "const "); | 116 | add_keyword(ctx, acc, "const", "const "); |
121 | add_keyword(ctx, acc, "type", "type "); | 117 | add_keyword(ctx, acc, "type", "type "); |
122 | } | 118 | } |
123 | if (ctx.has_item_list_or_source_file_parent && !has_trait_or_impl_parent) | 119 | if (ctx.has_item_list_or_source_file_parent) || ctx.block_expr_parent { |
124 | || ctx.block_expr_parent | ||
125 | { | ||
126 | add_keyword(ctx, acc, "static", "static "); | 120 | add_keyword(ctx, acc, "static", "static "); |
127 | }; | 121 | }; |
128 | if (ctx.has_item_list_or_source_file_parent && !has_trait_or_impl_parent) | 122 | if (ctx.has_item_list_or_source_file_parent) || ctx.block_expr_parent { |
129 | || ctx.block_expr_parent | ||
130 | { | ||
131 | add_keyword(ctx, acc, "extern", "extern "); | 123 | add_keyword(ctx, acc, "extern", "extern "); |
132 | } | 124 | } |
133 | if ctx.has_item_list_or_source_file_parent || ctx.block_expr_parent || ctx.is_match_arm { | 125 | if ctx.has_item_list_or_source_file_parent |
126 | || has_trait_or_impl_parent | ||
127 | || ctx.block_expr_parent | ||
128 | || ctx.is_match_arm | ||
129 | { | ||
134 | add_keyword(ctx, acc, "unsafe", "unsafe "); | 130 | add_keyword(ctx, acc, "unsafe", "unsafe "); |
135 | } | 131 | } |
136 | if ctx.in_loop_body { | 132 | if ctx.in_loop_body { |
@@ -142,7 +138,7 @@ pub(super) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionConte | |||
142 | add_keyword(ctx, acc, "break", "break"); | 138 | add_keyword(ctx, acc, "break", "break"); |
143 | } | 139 | } |
144 | } | 140 | } |
145 | if ctx.has_item_list_or_source_file_parent && !ctx.has_trait_parent { | 141 | if ctx.has_item_list_or_source_file_parent || ctx.has_impl_parent { |
146 | add_keyword(ctx, acc, "pub", "pub ") | 142 | add_keyword(ctx, acc, "pub", "pub ") |
147 | } | 143 | } |
148 | 144 | ||
diff --git a/crates/ra_ide/src/completion/patterns.rs b/crates/ra_ide/src/completion/patterns.rs index b2fe13280..175209d8a 100644 --- a/crates/ra_ide/src/completion/patterns.rs +++ b/crates/ra_ide/src/completion/patterns.rs | |||
@@ -13,7 +13,7 @@ use crate::completion::test_utils::check_pattern_is_applicable; | |||
13 | 13 | ||
14 | pub(crate) fn has_trait_parent(element: SyntaxElement) -> bool { | 14 | pub(crate) fn has_trait_parent(element: SyntaxElement) -> bool { |
15 | not_same_range_ancestor(element) | 15 | not_same_range_ancestor(element) |
16 | .filter(|it| it.kind() == ITEM_LIST) | 16 | .filter(|it| it.kind() == ASSOC_ITEM_LIST) |
17 | .and_then(|it| it.parent()) | 17 | .and_then(|it| it.parent()) |
18 | .filter(|it| it.kind() == TRAIT_DEF) | 18 | .filter(|it| it.kind() == TRAIT_DEF) |
19 | .is_some() | 19 | .is_some() |
@@ -25,7 +25,7 @@ fn test_has_trait_parent() { | |||
25 | 25 | ||
26 | pub(crate) fn has_impl_parent(element: SyntaxElement) -> bool { | 26 | pub(crate) fn has_impl_parent(element: SyntaxElement) -> bool { |
27 | not_same_range_ancestor(element) | 27 | not_same_range_ancestor(element) |
28 | .filter(|it| it.kind() == ITEM_LIST) | 28 | .filter(|it| it.kind() == ASSOC_ITEM_LIST) |
29 | .and_then(|it| it.parent()) | 29 | .and_then(|it| it.parent()) |
30 | .filter(|it| it.kind() == IMPL_DEF) | 30 | .filter(|it| it.kind() == IMPL_DEF) |
31 | .is_some() | 31 | .is_some() |
@@ -73,7 +73,7 @@ pub(crate) fn has_item_list_or_source_file_parent(element: SyntaxElement) -> boo | |||
73 | #[test] | 73 | #[test] |
74 | fn test_has_item_list_or_source_file_parent() { | 74 | fn test_has_item_list_or_source_file_parent() { |
75 | check_pattern_is_applicable(r"i<|>", has_item_list_or_source_file_parent); | 75 | check_pattern_is_applicable(r"i<|>", has_item_list_or_source_file_parent); |
76 | check_pattern_is_applicable(r"impl { f<|> }", has_item_list_or_source_file_parent); | 76 | check_pattern_is_applicable(r"mod foo { f<|> }", has_item_list_or_source_file_parent); |
77 | } | 77 | } |
78 | 78 | ||
79 | pub(crate) fn is_match_arm(element: SyntaxElement) -> bool { | 79 | pub(crate) fn is_match_arm(element: SyntaxElement) -> bool { |
diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs index de2c98afd..3350e23b9 100644 --- a/crates/ra_parser/src/grammar.rs +++ b/crates/ra_parser/src/grammar.rs | |||
@@ -149,12 +149,12 @@ pub(crate) fn reparser( | |||
149 | USE_TREE_LIST => items::use_tree_list, | 149 | USE_TREE_LIST => items::use_tree_list, |
150 | EXTERN_ITEM_LIST => items::extern_item_list, | 150 | EXTERN_ITEM_LIST => items::extern_item_list, |
151 | TOKEN_TREE if first_child? == T!['{'] => items::token_tree, | 151 | TOKEN_TREE if first_child? == T!['{'] => items::token_tree, |
152 | ITEM_LIST => match parent? { | 152 | ASSOC_ITEM_LIST => match parent? { |
153 | IMPL_DEF => items::impl_item_list, | 153 | IMPL_DEF => items::impl_item_list, |
154 | TRAIT_DEF => items::trait_item_list, | 154 | TRAIT_DEF => items::trait_item_list, |
155 | MODULE => items::mod_item_list, | ||
156 | _ => return None, | 155 | _ => return None, |
157 | }, | 156 | }, |
157 | ITEM_LIST => items::mod_item_list, | ||
158 | _ => return None, | 158 | _ => return None, |
159 | }; | 159 | }; |
160 | Some(res) | 160 | Some(res) |
diff --git a/crates/ra_parser/src/grammar/items/traits.rs b/crates/ra_parser/src/grammar/items/traits.rs index c819e33be..ef9c8ff5b 100644 --- a/crates/ra_parser/src/grammar/items/traits.rs +++ b/crates/ra_parser/src/grammar/items/traits.rs | |||
@@ -50,7 +50,7 @@ pub(crate) fn trait_item_list(p: &mut Parser) { | |||
50 | item_or_macro(p, true, ItemFlavor::Trait); | 50 | item_or_macro(p, true, ItemFlavor::Trait); |
51 | } | 51 | } |
52 | p.expect(T!['}']); | 52 | p.expect(T!['}']); |
53 | m.complete(p, ITEM_LIST); | 53 | m.complete(p, ASSOC_ITEM_LIST); |
54 | } | 54 | } |
55 | 55 | ||
56 | // test impl_def | 56 | // test impl_def |
@@ -107,7 +107,7 @@ pub(crate) fn impl_item_list(p: &mut Parser) { | |||
107 | item_or_macro(p, true, ItemFlavor::Mod); | 107 | item_or_macro(p, true, ItemFlavor::Mod); |
108 | } | 108 | } |
109 | p.expect(T!['}']); | 109 | p.expect(T!['}']); |
110 | m.complete(p, ITEM_LIST); | 110 | m.complete(p, ASSOC_ITEM_LIST); |
111 | } | 111 | } |
112 | 112 | ||
113 | // test impl_type_params | 113 | // test impl_type_params |
diff --git a/crates/ra_parser/src/syntax_kind/generated.rs b/crates/ra_parser/src/syntax_kind/generated.rs index 625f0c822..56dadc6af 100644 --- a/crates/ra_parser/src/syntax_kind/generated.rs +++ b/crates/ra_parser/src/syntax_kind/generated.rs | |||
@@ -213,6 +213,7 @@ pub enum SyntaxKind { | |||
213 | TUPLE_FIELD_DEF, | 213 | TUPLE_FIELD_DEF, |
214 | ENUM_VARIANT_LIST, | 214 | ENUM_VARIANT_LIST, |
215 | ITEM_LIST, | 215 | ITEM_LIST, |
216 | ASSOC_ITEM_LIST, | ||
216 | ATTR, | 217 | ATTR, |
217 | META_ITEM, | 218 | META_ITEM, |
218 | USE_TREE, | 219 | USE_TREE, |
diff --git a/crates/ra_syntax/src/ast/edit.rs b/crates/ra_syntax/src/ast/edit.rs index abc7a646c..01a310f66 100644 --- a/crates/ra_syntax/src/ast/edit.rs +++ b/crates/ra_syntax/src/ast/edit.rs | |||
@@ -80,9 +80,12 @@ where | |||
80 | } | 80 | } |
81 | } | 81 | } |
82 | 82 | ||
83 | impl ast::ItemList { | 83 | impl ast::AssocItemList { |
84 | #[must_use] | 84 | #[must_use] |
85 | pub fn append_items(&self, items: impl IntoIterator<Item = ast::AssocItem>) -> ast::ItemList { | 85 | pub fn append_items( |
86 | &self, | ||
87 | items: impl IntoIterator<Item = ast::AssocItem>, | ||
88 | ) -> ast::AssocItemList { | ||
86 | let mut res = self.clone(); | 89 | let mut res = self.clone(); |
87 | if !self.syntax().text().contains_char('\n') { | 90 | if !self.syntax().text().contains_char('\n') { |
88 | res = make_multiline(res); | 91 | res = make_multiline(res); |
@@ -92,7 +95,7 @@ impl ast::ItemList { | |||
92 | } | 95 | } |
93 | 96 | ||
94 | #[must_use] | 97 | #[must_use] |
95 | pub fn append_item(&self, item: ast::AssocItem) -> ast::ItemList { | 98 | pub fn append_item(&self, item: ast::AssocItem) -> ast::AssocItemList { |
96 | let (indent, position) = match self.assoc_items().last() { | 99 | let (indent, position) = match self.assoc_items().last() { |
97 | Some(it) => ( | 100 | Some(it) => ( |
98 | leading_indent(it.syntax()).unwrap_or_default().to_string(), | 101 | leading_indent(it.syntax()).unwrap_or_default().to_string(), |
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index dfda79550..fbf3b457a 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs | |||
@@ -112,7 +112,7 @@ impl ImplDef { | |||
112 | pub fn impl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![impl]) } | 112 | pub fn impl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![impl]) } |
113 | pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) } | 113 | pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) } |
114 | pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) } | 114 | pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) } |
115 | pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) } | 115 | pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) } |
116 | } | 116 | } |
117 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 117 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
118 | pub struct MacroCall { | 118 | pub struct MacroCall { |
@@ -180,7 +180,7 @@ impl TraitDef { | |||
180 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } | 180 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } |
181 | pub fn auto_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![auto]) } | 181 | pub fn auto_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![auto]) } |
182 | pub fn trait_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![trait]) } | 182 | pub fn trait_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![trait]) } |
183 | pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) } | 183 | pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) } |
184 | } | 184 | } |
185 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 185 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
186 | pub struct TypeAliasDef { | 186 | pub struct TypeAliasDef { |
@@ -238,11 +238,6 @@ impl Visibility { | |||
238 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } | 238 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
239 | } | 239 | } |
240 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 240 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
241 | pub struct Abi { | ||
242 | pub(crate) syntax: SyntaxNode, | ||
243 | } | ||
244 | impl Abi {} | ||
245 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
246 | pub struct Name { | 241 | pub struct Name { |
247 | pub(crate) syntax: SyntaxNode, | 242 | pub(crate) syntax: SyntaxNode, |
248 | } | 243 | } |
@@ -250,6 +245,21 @@ impl Name { | |||
250 | pub fn ident_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ident]) } | 245 | pub fn ident_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ident]) } |
251 | } | 246 | } |
252 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 247 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
248 | pub struct ItemList { | ||
249 | pub(crate) syntax: SyntaxNode, | ||
250 | } | ||
251 | impl ast::AttrsOwner for ItemList {} | ||
252 | impl ast::ModuleItemOwner for ItemList {} | ||
253 | impl ItemList { | ||
254 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } | ||
255 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } | ||
256 | } | ||
257 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
258 | pub struct Abi { | ||
259 | pub(crate) syntax: SyntaxNode, | ||
260 | } | ||
261 | impl Abi {} | ||
262 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
253 | pub struct TypeParamList { | 263 | pub struct TypeParamList { |
254 | pub(crate) syntax: SyntaxNode, | 264 | pub(crate) syntax: SyntaxNode, |
255 | } | 265 | } |
@@ -367,11 +377,10 @@ impl TypeBoundList { | |||
367 | pub fn bounds(&self) -> AstChildren<TypeBound> { support::children(&self.syntax) } | 377 | pub fn bounds(&self) -> AstChildren<TypeBound> { support::children(&self.syntax) } |
368 | } | 378 | } |
369 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 379 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
370 | pub struct ItemList { | 380 | pub struct AssocItemList { |
371 | pub(crate) syntax: SyntaxNode, | 381 | pub(crate) syntax: SyntaxNode, |
372 | } | 382 | } |
373 | impl ast::ModuleItemOwner for ItemList {} | 383 | impl AssocItemList { |
374 | impl ItemList { | ||
375 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } | 384 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
376 | pub fn assoc_items(&self) -> AstChildren<AssocItem> { support::children(&self.syntax) } | 385 | pub fn assoc_items(&self) -> AstChildren<AssocItem> { support::children(&self.syntax) } |
377 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } | 386 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
@@ -1336,10 +1345,10 @@ pub enum AssocItem { | |||
1336 | FnDef(FnDef), | 1345 | FnDef(FnDef), |
1337 | TypeAliasDef(TypeAliasDef), | 1346 | TypeAliasDef(TypeAliasDef), |
1338 | ConstDef(ConstDef), | 1347 | ConstDef(ConstDef), |
1348 | MacroCall(MacroCall), | ||
1339 | } | 1349 | } |
1340 | impl ast::AttrsOwner for AssocItem {} | 1350 | impl ast::AttrsOwner for AssocItem {} |
1341 | impl ast::NameOwner for AssocItem {} | 1351 | impl ast::NameOwner for AssocItem {} |
1342 | impl ast::VisibilityOwner for AssocItem {} | ||
1343 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1352 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1344 | pub enum Pat { | 1353 | pub enum Pat { |
1345 | OrPat(OrPat), | 1354 | OrPat(OrPat), |
@@ -1574,8 +1583,8 @@ impl AstNode for Visibility { | |||
1574 | } | 1583 | } |
1575 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1584 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1576 | } | 1585 | } |
1577 | impl AstNode for Abi { | 1586 | impl AstNode for Name { |
1578 | fn can_cast(kind: SyntaxKind) -> bool { kind == ABI } | 1587 | fn can_cast(kind: SyntaxKind) -> bool { kind == NAME } |
1579 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1588 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1580 | if Self::can_cast(syntax.kind()) { | 1589 | if Self::can_cast(syntax.kind()) { |
1581 | Some(Self { syntax }) | 1590 | Some(Self { syntax }) |
@@ -1585,8 +1594,19 @@ impl AstNode for Abi { | |||
1585 | } | 1594 | } |
1586 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1595 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1587 | } | 1596 | } |
1588 | impl AstNode for Name { | 1597 | impl AstNode for ItemList { |
1589 | fn can_cast(kind: SyntaxKind) -> bool { kind == NAME } | 1598 | fn can_cast(kind: SyntaxKind) -> bool { kind == ITEM_LIST } |
1599 | fn cast(syntax: SyntaxNode) -> Option<Self> { | ||
1600 | if Self::can_cast(syntax.kind()) { | ||
1601 | Some(Self { syntax }) | ||
1602 | } else { | ||
1603 | None | ||
1604 | } | ||
1605 | } | ||
1606 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | ||
1607 | } | ||
1608 | impl AstNode for Abi { | ||
1609 | fn can_cast(kind: SyntaxKind) -> bool { kind == ABI } | ||
1590 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1610 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1591 | if Self::can_cast(syntax.kind()) { | 1611 | if Self::can_cast(syntax.kind()) { |
1592 | Some(Self { syntax }) | 1612 | Some(Self { syntax }) |
@@ -1728,8 +1748,8 @@ impl AstNode for TypeBoundList { | |||
1728 | } | 1748 | } |
1729 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1749 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1730 | } | 1750 | } |
1731 | impl AstNode for ItemList { | 1751 | impl AstNode for AssocItemList { |
1732 | fn can_cast(kind: SyntaxKind) -> bool { kind == ITEM_LIST } | 1752 | fn can_cast(kind: SyntaxKind) -> bool { kind == ASSOC_ITEM_LIST } |
1733 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1753 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1734 | if Self::can_cast(syntax.kind()) { | 1754 | if Self::can_cast(syntax.kind()) { |
1735 | Some(Self { syntax }) | 1755 | Some(Self { syntax }) |
@@ -3144,10 +3164,13 @@ impl From<TypeAliasDef> for AssocItem { | |||
3144 | impl From<ConstDef> for AssocItem { | 3164 | impl From<ConstDef> for AssocItem { |
3145 | fn from(node: ConstDef) -> AssocItem { AssocItem::ConstDef(node) } | 3165 | fn from(node: ConstDef) -> AssocItem { AssocItem::ConstDef(node) } |
3146 | } | 3166 | } |
3167 | impl From<MacroCall> for AssocItem { | ||
3168 | fn from(node: MacroCall) -> AssocItem { AssocItem::MacroCall(node) } | ||
3169 | } | ||
3147 | impl AstNode for AssocItem { | 3170 | impl AstNode for AssocItem { |
3148 | fn can_cast(kind: SyntaxKind) -> bool { | 3171 | fn can_cast(kind: SyntaxKind) -> bool { |
3149 | match kind { | 3172 | match kind { |
3150 | FN_DEF | TYPE_ALIAS_DEF | CONST_DEF => true, | 3173 | FN_DEF | TYPE_ALIAS_DEF | CONST_DEF | MACRO_CALL => true, |
3151 | _ => false, | 3174 | _ => false, |
3152 | } | 3175 | } |
3153 | } | 3176 | } |
@@ -3156,6 +3179,7 @@ impl AstNode for AssocItem { | |||
3156 | FN_DEF => AssocItem::FnDef(FnDef { syntax }), | 3179 | FN_DEF => AssocItem::FnDef(FnDef { syntax }), |
3157 | TYPE_ALIAS_DEF => AssocItem::TypeAliasDef(TypeAliasDef { syntax }), | 3180 | TYPE_ALIAS_DEF => AssocItem::TypeAliasDef(TypeAliasDef { syntax }), |
3158 | CONST_DEF => AssocItem::ConstDef(ConstDef { syntax }), | 3181 | CONST_DEF => AssocItem::ConstDef(ConstDef { syntax }), |
3182 | MACRO_CALL => AssocItem::MacroCall(MacroCall { syntax }), | ||
3159 | _ => return None, | 3183 | _ => return None, |
3160 | }; | 3184 | }; |
3161 | Some(res) | 3185 | Some(res) |
@@ -3165,6 +3189,7 @@ impl AstNode for AssocItem { | |||
3165 | AssocItem::FnDef(it) => &it.syntax, | 3189 | AssocItem::FnDef(it) => &it.syntax, |
3166 | AssocItem::TypeAliasDef(it) => &it.syntax, | 3190 | AssocItem::TypeAliasDef(it) => &it.syntax, |
3167 | AssocItem::ConstDef(it) => &it.syntax, | 3191 | AssocItem::ConstDef(it) => &it.syntax, |
3192 | AssocItem::MacroCall(it) => &it.syntax, | ||
3168 | } | 3193 | } |
3169 | } | 3194 | } |
3170 | } | 3195 | } |
@@ -3515,12 +3540,17 @@ impl std::fmt::Display for Visibility { | |||
3515 | std::fmt::Display::fmt(self.syntax(), f) | 3540 | std::fmt::Display::fmt(self.syntax(), f) |
3516 | } | 3541 | } |
3517 | } | 3542 | } |
3518 | impl std::fmt::Display for Abi { | 3543 | impl std::fmt::Display for Name { |
3519 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3544 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3520 | std::fmt::Display::fmt(self.syntax(), f) | 3545 | std::fmt::Display::fmt(self.syntax(), f) |
3521 | } | 3546 | } |
3522 | } | 3547 | } |
3523 | impl std::fmt::Display for Name { | 3548 | impl std::fmt::Display for ItemList { |
3549 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
3550 | std::fmt::Display::fmt(self.syntax(), f) | ||
3551 | } | ||
3552 | } | ||
3553 | impl std::fmt::Display for Abi { | ||
3524 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3554 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3525 | std::fmt::Display::fmt(self.syntax(), f) | 3555 | std::fmt::Display::fmt(self.syntax(), f) |
3526 | } | 3556 | } |
@@ -3585,7 +3615,7 @@ impl std::fmt::Display for TypeBoundList { | |||
3585 | std::fmt::Display::fmt(self.syntax(), f) | 3615 | std::fmt::Display::fmt(self.syntax(), f) |
3586 | } | 3616 | } |
3587 | } | 3617 | } |
3588 | impl std::fmt::Display for ItemList { | 3618 | impl std::fmt::Display for AssocItemList { |
3589 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3619 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3590 | std::fmt::Display::fmt(self.syntax(), f) | 3620 | std::fmt::Display::fmt(self.syntax(), f) |
3591 | } | 3621 | } |
diff --git a/crates/ra_syntax/test_data/parser/err/0018_incomplete_fn.rast b/crates/ra_syntax/test_data/parser/err/0018_incomplete_fn.rast index 31cc4e551..a87e5061a 100644 --- a/crates/ra_syntax/test_data/parser/err/0018_incomplete_fn.rast +++ b/crates/ra_syntax/test_data/parser/err/0018_incomplete_fn.rast | |||
@@ -8,7 +8,7 @@ [email protected] | |||
8 | [email protected] | 8 | [email protected] |
9 | [email protected] "FnScopes" | 9 | [email protected] "FnScopes" |
10 | [email protected] " " | 10 | [email protected] " " |
11 | [email protected] | 11 | ASSOC_[email protected] |
12 | [email protected] "{" | 12 | [email protected] "{" |
13 | [email protected] "\n " | 13 | [email protected] "\n " |
14 | [email protected] | 14 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/err/0026_imp_recovery.rast b/crates/ra_syntax/test_data/parser/err/0026_imp_recovery.rast index bf07409fb..254ff546a 100644 --- a/crates/ra_syntax/test_data/parser/err/0026_imp_recovery.rast +++ b/crates/ra_syntax/test_data/parser/err/0026_imp_recovery.rast | |||
@@ -41,7 +41,7 @@ [email protected] | |||
41 | [email protected] "T" | 41 | [email protected] "T" |
42 | [email protected] ">" | 42 | [email protected] ">" |
43 | [email protected] " " | 43 | [email protected] " " |
44 | [email protected] | 44 | ASSOC_[email protected] |
45 | [email protected] "{" | 45 | [email protected] "{" |
46 | [email protected] "}" | 46 | [email protected] "}" |
47 | [email protected] "\n" | 47 | [email protected] "\n" |
diff --git a/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast b/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast index e3cda7c43..bc446e3df 100644 --- a/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast +++ b/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast | |||
@@ -14,7 +14,7 @@ [email protected] | |||
14 | [email protected] "(" | 14 | [email protected] "(" |
15 | [email protected] ")" | 15 | [email protected] ")" |
16 | [email protected] " " | 16 | [email protected] " " |
17 | [email protected] | 17 | ASSOC_[email protected] |
18 | [email protected] "{" | 18 | [email protected] "{" |
19 | [email protected] "\n " | 19 | [email protected] "\n " |
20 | [email protected] | 20 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/err/0043_default_const.rast b/crates/ra_syntax/test_data/parser/err/0043_default_const.rast index 8eb583ef8..6ca1a4870 100644 --- a/crates/ra_syntax/test_data/parser/err/0043_default_const.rast +++ b/crates/ra_syntax/test_data/parser/err/0043_default_const.rast | |||
@@ -5,7 +5,7 @@ [email protected] | |||
5 | [email protected] | 5 | [email protected] |
6 | [email protected] "T" | 6 | [email protected] "T" |
7 | [email protected] " " | 7 | [email protected] " " |
8 | [email protected] | 8 | ASSOC_[email protected] |
9 | [email protected] "{" | 9 | [email protected] "{" |
10 | [email protected] "\n " | 10 | [email protected] "\n " |
11 | [email protected] | 11 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.rast b/crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.rast index fd939be8d..2d0253aa0 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.rast | |||
@@ -8,7 +8,7 @@ [email protected] | |||
8 | [email protected] | 8 | [email protected] |
9 | [email protected] "Type" | 9 | [email protected] "Type" |
10 | [email protected] " " | 10 | [email protected] " " |
11 | [email protected] | 11 | ASSOC_[email protected] |
12 | [email protected] "{" | 12 | [email protected] "{" |
13 | [email protected] "}" | 13 | [email protected] "}" |
14 | [email protected] "\n" | 14 | [email protected] "\n" |
@@ -29,7 +29,7 @@ [email protected] | |||
29 | [email protected] | 29 | [email protected] |
30 | [email protected] "T" | 30 | [email protected] "T" |
31 | [email protected] " " | 31 | [email protected] " " |
32 | [email protected] | 32 | ASSOC_[email protected] |
33 | [email protected] "{" | 33 | [email protected] "{" |
34 | [email protected] "}" | 34 | [email protected] "}" |
35 | [email protected] "\n" | 35 | [email protected] "\n" |
@@ -45,7 +45,7 @@ [email protected] | |||
45 | [email protected] | 45 | [email protected] |
46 | [email protected] "NotType" | 46 | [email protected] "NotType" |
47 | [email protected] " " | 47 | [email protected] " " |
48 | [email protected] | 48 | ASSOC_[email protected] |
49 | [email protected] "{" | 49 | [email protected] "{" |
50 | [email protected] "}" | 50 | [email protected] "}" |
51 | [email protected] "\n" | 51 | [email protected] "\n" |
@@ -69,7 +69,7 @@ [email protected] | |||
69 | [email protected] | 69 | [email protected] |
70 | [email protected] "NotType" | 70 | [email protected] "NotType" |
71 | [email protected] " " | 71 | [email protected] " " |
72 | [email protected] | 72 | ASSOC_[email protected] |
73 | [email protected] "{" | 73 | [email protected] "{" |
74 | [email protected] "}" | 74 | [email protected] "}" |
75 | [email protected] "\n" | 75 | [email protected] "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast index b8cd0587d..5501dc5a6 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast | |||
@@ -5,7 +5,7 @@ [email protected] | |||
5 | [email protected] | 5 | [email protected] |
6 | [email protected] "T" | 6 | [email protected] "T" |
7 | [email protected] " " | 7 | [email protected] " " |
8 | [email protected] | 8 | ASSOC_[email protected] |
9 | [email protected] "{" | 9 | [email protected] "{" |
10 | [email protected] "\n " | 10 | [email protected] "\n " |
11 | [email protected] | 11 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast b/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast index a38b4f573..f422acdda 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast | |||
@@ -8,7 +8,7 @@ [email protected] | |||
8 | [email protected] | 8 | [email protected] |
9 | [email protected] "F" | 9 | [email protected] "F" |
10 | [email protected] " " | 10 | [email protected] " " |
11 | [email protected] | 11 | ASSOC_[email protected] |
12 | [email protected] "{" | 12 | [email protected] "{" |
13 | [email protected] "\n " | 13 | [email protected] "\n " |
14 | [email protected] | 14 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rast b/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rast index 9f4a9e69b..0cd1dffc9 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rast | |||
@@ -8,7 +8,7 @@ [email protected] | |||
8 | [email protected] | 8 | [email protected] |
9 | [email protected] "S" | 9 | [email protected] "S" |
10 | [email protected] " " | 10 | [email protected] " " |
11 | [email protected] | 11 | ASSOC_[email protected] |
12 | [email protected] "{" | 12 | [email protected] "{" |
13 | [email protected] "\n " | 13 | [email protected] "\n " |
14 | [email protected] | 14 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.rast b/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.rast index d59c6006d..69b82e33c 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.rast | |||
@@ -7,7 +7,7 @@ [email protected] | |||
7 | [email protected] | 7 | [email protected] |
8 | [email protected] "T" | 8 | [email protected] "T" |
9 | [email protected] " " | 9 | [email protected] " " |
10 | [email protected] | 10 | ASSOC_[email protected] |
11 | [email protected] "{" | 11 | [email protected] "{" |
12 | [email protected] "}" | 12 | [email protected] "}" |
13 | [email protected] "\n" | 13 | [email protected] "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rast b/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rast index 15da6fdd6..79148e953 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rast | |||
@@ -8,7 +8,7 @@ [email protected] | |||
8 | [email protected] | 8 | [email protected] |
9 | [email protected] "S" | 9 | [email protected] "S" |
10 | [email protected] " " | 10 | [email protected] " " |
11 | [email protected] | 11 | ASSOC_[email protected] |
12 | [email protected] "{" | 12 | [email protected] "{" |
13 | [email protected] "\n " | 13 | [email protected] "\n " |
14 | [email protected] | 14 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rast b/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rast index c204aeb63..31b5b6616 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rast | |||
@@ -8,7 +8,7 @@ [email protected] | |||
8 | [email protected] | 8 | [email protected] |
9 | [email protected] "F" | 9 | [email protected] "F" |
10 | [email protected] " " | 10 | [email protected] " " |
11 | [email protected] | 11 | ASSOC_[email protected] |
12 | [email protected] "{" | 12 | [email protected] "{" |
13 | [email protected] "\n " | 13 | [email protected] "\n " |
14 | [email protected] | 14 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0041_trait_item.rast b/crates/ra_syntax/test_data/parser/inline/ok/0041_trait_item.rast index 1ae791361..884ab2dbf 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0041_trait_item.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0041_trait_item.rast | |||
@@ -48,7 +48,7 @@ [email protected] | |||
48 | [email protected] | 48 | [email protected] |
49 | [email protected] "Copy" | 49 | [email protected] "Copy" |
50 | [email protected] " " | 50 | [email protected] " " |
51 | [email protected] | 51 | ASSOC_[email protected] |
52 | [email protected] "{" | 52 | [email protected] "{" |
53 | [email protected] "}" | 53 | [email protected] "}" |
54 | [email protected] "\n" | 54 | [email protected] "\n" |
@@ -119,7 +119,7 @@ [email protected] | |||
119 | [email protected] | 119 | [email protected] |
120 | [email protected] "Copy" | 120 | [email protected] "Copy" |
121 | [email protected] " " | 121 | [email protected] " " |
122 | [email protected] | 122 | ASSOC_[email protected] |
123 | [email protected] "{" | 123 | [email protected] "{" |
124 | [email protected] "}" | 124 | [email protected] "}" |
125 | [email protected] "\n" | 125 | [email protected] "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.rast b/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.rast index 52de6023b..8a6b5a8fc 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.rast | |||
@@ -12,7 +12,7 @@ [email protected] | |||
12 | [email protected] | 12 | [email protected] |
13 | [email protected] "Foo" | 13 | [email protected] "Foo" |
14 | [email protected] " " | 14 | [email protected] " " |
15 | [email protected] | 15 | ASSOC_[email protected] |
16 | [email protected] "{" | 16 | [email protected] "{" |
17 | [email protected] "}" | 17 | [email protected] "}" |
18 | [email protected] "\n" | 18 | [email protected] "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0050_fn_decl.rast b/crates/ra_syntax/test_data/parser/inline/ok/0050_fn_decl.rast index 8bf62cda9..5f1429102 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0050_fn_decl.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0050_fn_decl.rast | |||
@@ -5,7 +5,7 @@ [email protected] | |||
5 | [email protected] | 5 | [email protected] |
6 | [email protected] "T" | 6 | [email protected] "T" |
7 | [email protected] " " | 7 | [email protected] " " |
8 | [email protected] | 8 | ASSOC_[email protected] |
9 | [email protected] "{" | 9 | [email protected] "{" |
10 | [email protected] " " | 10 | [email protected] " " |
11 | [email protected] | 11 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0063_impl_def_neg.rast b/crates/ra_syntax/test_data/parser/inline/ok/0063_impl_def_neg.rast index 24b9a1f46..31178f86e 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0063_impl_def_neg.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0063_impl_def_neg.rast | |||
@@ -17,7 +17,7 @@ [email protected] | |||
17 | [email protected] | 17 | [email protected] |
18 | [email protected] "X" | 18 | [email protected] "X" |
19 | [email protected] " " | 19 | [email protected] " " |
20 | [email protected] | 20 | ASSOC_[email protected] |
21 | [email protected] "{" | 21 | [email protected] "{" |
22 | [email protected] "}" | 22 | [email protected] "}" |
23 | [email protected] "\n" | 23 | [email protected] "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0079_impl_def.rast b/crates/ra_syntax/test_data/parser/inline/ok/0079_impl_def.rast index a00ab40f9..26825ef86 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0079_impl_def.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0079_impl_def.rast | |||
@@ -8,7 +8,7 @@ [email protected] | |||
8 | [email protected] | 8 | [email protected] |
9 | [email protected] "Foo" | 9 | [email protected] "Foo" |
10 | [email protected] " " | 10 | [email protected] " " |
11 | [email protected] | 11 | ASSOC_[email protected] |
12 | [email protected] "{" | 12 | [email protected] "{" |
13 | [email protected] "}" | 13 | [email protected] "}" |
14 | [email protected] "\n" | 14 | [email protected] "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.rast b/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.rast index 01ed3afca..e3223cee5 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.rast | |||
@@ -10,7 +10,7 @@ [email protected] | |||
10 | [email protected] | 10 | [email protected] |
11 | [email protected] "Foo" | 11 | [email protected] "Foo" |
12 | [email protected] " " | 12 | [email protected] " " |
13 | [email protected] | 13 | ASSOC_[email protected] |
14 | [email protected] "{" | 14 | [email protected] "{" |
15 | [email protected] "}" | 15 | [email protected] "}" |
16 | [email protected] "\n" | 16 | [email protected] "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.rast b/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.rast index 800412cef..7efa4c34d 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.rast | |||
@@ -7,7 +7,7 @@ [email protected] | |||
7 | [email protected] | 7 | [email protected] |
8 | [email protected] "T" | 8 | [email protected] "T" |
9 | [email protected] " " | 9 | [email protected] " " |
10 | [email protected] | 10 | ASSOC_[email protected] |
11 | [email protected] "{" | 11 | [email protected] "{" |
12 | [email protected] "}" | 12 | [email protected] "}" |
13 | [email protected] "\n" | 13 | [email protected] "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.rast b/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.rast index 9370f6ae7..fad27be66 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.rast | |||
@@ -9,7 +9,7 @@ [email protected] | |||
9 | [email protected] | 9 | [email protected] |
10 | [email protected] "T" | 10 | [email protected] "T" |
11 | [email protected] " " | 11 | [email protected] " " |
12 | [email protected] | 12 | ASSOC_[email protected] |
13 | [email protected] "{" | 13 | [email protected] "{" |
14 | [email protected] "}" | 14 | [email protected] "}" |
15 | [email protected] "\n" | 15 | [email protected] "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.rast b/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.rast index 80bda4ba7..8a839a4a6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.rast | |||
@@ -10,7 +10,7 @@ [email protected] | |||
10 | [email protected] | 10 | [email protected] |
11 | [email protected] "Foo" | 11 | [email protected] "Foo" |
12 | [email protected] " " | 12 | [email protected] " " |
13 | [email protected] | 13 | ASSOC_[email protected] |
14 | [email protected] "{" | 14 | [email protected] "{" |
15 | [email protected] "}" | 15 | [email protected] "}" |
16 | [email protected] "\n" | 16 | [email protected] "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rast b/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rast index a65a5c85f..ea54347fc 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rast | |||
@@ -17,7 +17,7 @@ [email protected] | |||
17 | [email protected] | 17 | [email protected] |
18 | [email protected] "F" | 18 | [email protected] "F" |
19 | [email protected] " " | 19 | [email protected] " " |
20 | [email protected] | 20 | ASSOC_[email protected] |
21 | [email protected] "{" | 21 | [email protected] "{" |
22 | [email protected] "\n " | 22 | [email protected] "\n " |
23 | [email protected] "//! This is a doc com ..." | 23 | [email protected] "//! This is a doc com ..." |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.rast index 00ce5ecf0..3772cb64b 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.rast | |||
@@ -16,7 +16,7 @@ [email protected] | |||
16 | [email protected] | 16 | [email protected] |
17 | [email protected] "Foo" | 17 | [email protected] "Foo" |
18 | [email protected] " " | 18 | [email protected] " " |
19 | [email protected] | 19 | ASSOC_[email protected] |
20 | [email protected] "{" | 20 | [email protected] "{" |
21 | [email protected] "\n " | 21 | [email protected] "\n " |
22 | [email protected] | 22 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.rast b/crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.rast index e70c3b710..77e12cad6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.rast | |||
@@ -32,7 +32,7 @@ [email protected] | |||
32 | [email protected] "N" | 32 | [email protected] "N" |
33 | [email protected] ">" | 33 | [email protected] ">" |
34 | [email protected] " " | 34 | [email protected] " " |
35 | [email protected] | 35 | ASSOC_[email protected] |
36 | [email protected] "{" | 36 | [email protected] "{" |
37 | [email protected] "}" | 37 | [email protected] "}" |
38 | [email protected] "\n" | 38 | [email protected] "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_fn.rast b/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_fn.rast index adb6159f4..c0b8c0300 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_fn.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_fn.rast | |||
@@ -16,7 +16,7 @@ [email protected] | |||
16 | [email protected] | 16 | [email protected] |
17 | [email protected] "Foo" | 17 | [email protected] "Foo" |
18 | [email protected] " " | 18 | [email protected] " " |
19 | [email protected] | 19 | ASSOC_[email protected] |
20 | [email protected] "{" | 20 | [email protected] "{" |
21 | [email protected] "\n " | 21 | [email protected] "\n " |
22 | [email protected] | 22 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_impl.rast b/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_impl.rast index a9eda5668..e0c338297 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_impl.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_impl.rast | |||
@@ -12,7 +12,7 @@ [email protected] | |||
12 | [email protected] | 12 | [email protected] |
13 | [email protected] "Foo" | 13 | [email protected] "Foo" |
14 | [email protected] " " | 14 | [email protected] " " |
15 | [email protected] | 15 | ASSOC_[email protected] |
16 | [email protected] "{" | 16 | [email protected] "{" |
17 | [email protected] "}" | 17 | [email protected] "}" |
18 | [email protected] "\n" | 18 | [email protected] "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0030_traits.rast b/crates/ra_syntax/test_data/parser/ok/0030_traits.rast index 0aadc11a4..63693de4f 100644 --- a/crates/ra_syntax/test_data/parser/ok/0030_traits.rast +++ b/crates/ra_syntax/test_data/parser/ok/0030_traits.rast | |||
@@ -5,7 +5,7 @@ [email protected] | |||
5 | [email protected] | 5 | [email protected] |
6 | [email protected] "Runnable" | 6 | [email protected] "Runnable" |
7 | [email protected] " " | 7 | [email protected] " " |
8 | [email protected] | 8 | ASSOC_[email protected] |
9 | [email protected] "{" | 9 | [email protected] "{" |
10 | [email protected] "\n " | 10 | [email protected] "\n " |
11 | [email protected] | 11 | [email protected] |
@@ -26,7 +26,7 @@ [email protected] | |||
26 | [email protected] | 26 | [email protected] |
27 | [email protected] "TraitWithExpr" | 27 | [email protected] "TraitWithExpr" |
28 | [email protected] " " | 28 | [email protected] " " |
29 | [email protected] | 29 | ASSOC_[email protected] |
30 | [email protected] "{" | 30 | [email protected] "{" |
31 | [email protected] "\n " | 31 | [email protected] "\n " |
32 | [email protected] | 32 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.rast b/crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.rast index 468982b74..573edc081 100644 --- a/crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.rast +++ b/crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.rast | |||
@@ -17,7 +17,7 @@ [email protected] | |||
17 | [email protected] | 17 | [email protected] |
18 | [email protected] "Foo" | 18 | [email protected] "Foo" |
19 | [email protected] " " | 19 | [email protected] " " |
20 | [email protected] | 20 | ASSOC_[email protected] |
21 | [email protected] "{" | 21 | [email protected] "{" |
22 | [email protected] "\n " | 22 | [email protected] "\n " |
23 | [email protected] | 23 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/ok/0045_block_inner_attrs.rast b/crates/ra_syntax/test_data/parser/ok/0045_block_inner_attrs.rast index e8b095251..69aa0ba4d 100644 --- a/crates/ra_syntax/test_data/parser/ok/0045_block_inner_attrs.rast +++ b/crates/ra_syntax/test_data/parser/ok/0045_block_inner_attrs.rast | |||
@@ -98,7 +98,7 @@ [email protected] | |||
98 | [email protected] | 98 | [email protected] |
99 | [email protected] "Whatever" | 99 | [email protected] "Whatever" |
100 | [email protected] " " | 100 | [email protected] " " |
101 | [email protected] | 101 | ASSOC_[email protected] |
102 | [email protected] "{" | 102 | [email protected] "{" |
103 | [email protected] "\n " | 103 | [email protected] "\n " |
104 | [email protected] | 104 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rast b/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rast index 816740a7c..919c690de 100644 --- a/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rast +++ b/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rast | |||
@@ -192,7 +192,7 @@ [email protected] | |||
192 | [email protected] | 192 | [email protected] |
193 | [email protected] "Foo" | 193 | [email protected] "Foo" |
194 | [email protected] " " | 194 | [email protected] " " |
195 | [email protected] | 195 | ASSOC_[email protected] |
196 | [email protected] "{" | 196 | [email protected] "{" |
197 | [email protected] "\n " | 197 | [email protected] "\n " |
198 | [email protected] | 198 | [email protected] |
@@ -260,7 +260,7 @@ [email protected] | |||
260 | [email protected] | 260 | [email protected] |
261 | [email protected] "S" | 261 | [email protected] "S" |
262 | [email protected] " " | 262 | [email protected] " " |
263 | [email protected] | 263 | ASSOC_[email protected] |
264 | [email protected] "{" | 264 | [email protected] "{" |
265 | [email protected] "\n " | 265 | [email protected] "\n " |
266 | [email protected] | 266 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/ok/0063_trait_fn_patterns.rast b/crates/ra_syntax/test_data/parser/ok/0063_trait_fn_patterns.rast index 886b211d0..40619b46e 100644 --- a/crates/ra_syntax/test_data/parser/ok/0063_trait_fn_patterns.rast +++ b/crates/ra_syntax/test_data/parser/ok/0063_trait_fn_patterns.rast | |||
@@ -5,7 +5,7 @@ [email protected] | |||
5 | [email protected] | 5 | [email protected] |
6 | [email protected] "T" | 6 | [email protected] "T" |
7 | [email protected] " " | 7 | [email protected] " " |
8 | [email protected] | 8 | ASSOC_[email protected] |
9 | [email protected] "{" | 9 | [email protected] "{" |
10 | [email protected] "\n " | 10 | [email protected] "\n " |
11 | [email protected] | 11 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/ok/0064_impl_fn_params.rast b/crates/ra_syntax/test_data/parser/ok/0064_impl_fn_params.rast index a0423806c..7b026e33b 100644 --- a/crates/ra_syntax/test_data/parser/ok/0064_impl_fn_params.rast +++ b/crates/ra_syntax/test_data/parser/ok/0064_impl_fn_params.rast | |||
@@ -8,7 +8,7 @@ [email protected] | |||
8 | [email protected] | 8 | [email protected] |
9 | [email protected] "U" | 9 | [email protected] "U" |
10 | [email protected] " " | 10 | [email protected] " " |
11 | [email protected] | 11 | ASSOC_[email protected] |
12 | [email protected] "{" | 12 | [email protected] "{" |
13 | [email protected] "\n " | 13 | [email protected] "\n " |
14 | [email protected] | 14 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/ok/0066_default_const.rast b/crates/ra_syntax/test_data/parser/ok/0066_default_const.rast index dab0247ee..584b2faf1 100644 --- a/crates/ra_syntax/test_data/parser/ok/0066_default_const.rast +++ b/crates/ra_syntax/test_data/parser/ok/0066_default_const.rast | |||
@@ -16,7 +16,7 @@ [email protected] | |||
16 | [email protected] | 16 | [email protected] |
17 | [email protected] "Foo" | 17 | [email protected] "Foo" |
18 | [email protected] " " | 18 | [email protected] " " |
19 | [email protected] | 19 | ASSOC_[email protected] |
20 | [email protected] "{" | 20 | [email protected] "{" |
21 | [email protected] "\n " | 21 | [email protected] "\n " |
22 | [email protected] | 22 | [email protected] |
diff --git a/xtask/src/ast_src.rs b/xtask/src/ast_src.rs index 83449437b..d2a408e77 100644 --- a/xtask/src/ast_src.rs +++ b/xtask/src/ast_src.rs | |||
@@ -186,6 +186,7 @@ pub(crate) const KINDS_SRC: KindsSrc = KindsSrc { | |||
186 | "TUPLE_FIELD_DEF", | 186 | "TUPLE_FIELD_DEF", |
187 | "ENUM_VARIANT_LIST", | 187 | "ENUM_VARIANT_LIST", |
188 | "ITEM_LIST", | 188 | "ITEM_LIST", |
189 | "ASSOC_ITEM_LIST", | ||
189 | "ATTR", | 190 | "ATTR", |
190 | "META_ITEM", // not an item actually | 191 | "META_ITEM", // not an item actually |
191 | "USE_TREE", | 192 | "USE_TREE", |
diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index a93cb3815..470ac8c8f 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram | |||
@@ -19,6 +19,13 @@ Item = | |||
19 | | UnionDef | 19 | | UnionDef |
20 | | UseItem | 20 | | UseItem |
21 | 21 | ||
22 | Module = | ||
23 | Attr* Visibility? 'mod' Name | ||
24 | (ItemList | ';') | ||
25 | |||
26 | ItemList = | ||
27 | '{' Attr* Item* '}' | ||
28 | |||
22 | FnDef = | 29 | FnDef = |
23 | Attr* Visibility? Abi? 'const' 'default' 'async' 'unsafe' 'fn' Name TypeParamList? | 30 | Attr* Visibility? Abi? 'const' 'default' 'async' 'unsafe' 'fn' Name TypeParamList? |
24 | ParamList RetType? | 31 | ParamList RetType? |
@@ -67,17 +74,10 @@ EnumVariant = | |||
67 | TraitDef = | 74 | TraitDef = |
68 | Attr* Visibility? 'unsafe'? 'auto'? 'trait' Name TypeParamList | 75 | Attr* Visibility? 'unsafe'? 'auto'? 'trait' Name TypeParamList |
69 | (':' TypeBoundList?)? WhereClause | 76 | (':' TypeBoundList?)? WhereClause |
70 | ItemList | 77 | AssocItemList |
71 | 78 | ||
72 | Module = | 79 | AssocItemList = |
73 | Attr* Visibility? 'mod' Name | 80 | '{' AssocItem* '}' |
74 | (ItemList | ';') | ||
75 | |||
76 | ItemList = | ||
77 | '{' | ||
78 | AssocItem* | ||
79 | Item* | ||
80 | '}' | ||
81 | 81 | ||
82 | ConstDef = | 82 | ConstDef = |
83 | Attr* Visibility? 'default'? 'const' Name ':' ascribed_type:TypeRef | 83 | Attr* Visibility? 'default'? 'const' Name ':' ascribed_type:TypeRef |
@@ -94,7 +94,7 @@ TypeAliasDef = | |||
94 | ImplDef = | 94 | ImplDef = |
95 | Attr* Visibility? 'const'? 'default'? 'unsafe'? 'impl' TypeParamList? '!'? 'for' | 95 | Attr* Visibility? 'const'? 'default'? 'unsafe'? 'impl' TypeParamList? '!'? 'for' |
96 | WhereClause? | 96 | WhereClause? |
97 | ItemList | 97 | AssocItemList |
98 | 98 | ||
99 | ParenType = | 99 | ParenType = |
100 | '(' TypeRef ')' | 100 | '(' TypeRef ')' |
@@ -467,6 +467,7 @@ AssocItem = | |||
467 | FnDef | 467 | FnDef |
468 | | TypeAliasDef | 468 | | TypeAliasDef |
469 | | ConstDef | 469 | | ConstDef |
470 | | MacroCall | ||
470 | 471 | ||
471 | ExternItem = | 472 | ExternItem = |
472 | FnDef | StaticDef | 473 | FnDef | StaticDef |