aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar/expressions
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-01-17 10:50:06 +0000
committerGitHub <[email protected]>2020-01-17 10:50:06 +0000
commit07dca1123dfaec527c6ba3164125309f5c4cc3db (patch)
tree36e66272f2da663034059df83f299e20c84d27de /crates/ra_parser/src/grammar/expressions
parent90b8a31b83b1aafc3fb555ba4307527f9258f46d (diff)
parent3a859e587f3bcf9f49293bd1f2b2d19cdfd2be4b (diff)
Merge #2867
2867: Nest attrs into exprs in function args r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_parser/src/grammar/expressions')
-rw-r--r--crates/ra_parser/src/grammar/expressions/atom.rs15
1 files changed, 2 insertions, 13 deletions
diff --git a/crates/ra_parser/src/grammar/expressions/atom.rs b/crates/ra_parser/src/grammar/expressions/atom.rs
index a98a2a3ef..2cc321473 100644
--- a/crates/ra_parser/src/grammar/expressions/atom.rs
+++ b/crates/ra_parser/src/grammar/expressions/atom.rs
@@ -191,19 +191,8 @@ fn array_expr(p: &mut Parser) -> CompletedMarker {
191 191
192 // test array_attrs 192 // test array_attrs
193 // const A: &[i64] = &[1, #[cfg(test)] 2]; 193 // const A: &[i64] = &[1, #[cfg(test)] 2];
194 let m = p.start(); 194 if !expr_with_attrs(p) {
195 let has_attrs = p.at(T![#]); 195 break;
196 attributes::outer_attributes(p);
197
198 let cm = expr(p).0;
199
200 match (has_attrs, cm) {
201 (true, Some(cm)) => {
202 let kind = cm.kind();
203 cm.undo_completion(p).abandon(p);
204 m.complete(p, kind);
205 }
206 _ => m.abandon(p),
207 } 196 }
208 197
209 if n_exprs == 1 && p.eat(T![;]) { 198 if n_exprs == 1 && p.eat(T![;]) {