diff options
author | pcpthm <[email protected]> | 2019-03-16 15:27:07 +0000 |
---|---|---|
committer | pcpthm <[email protected]> | 2019-03-17 10:08:35 +0000 |
commit | a1d84f5fb033113a0a0b9a0b4d9951a6a0bf04b8 (patch) | |
tree | e8253f38bebf21dd050484d15859b0eb893e23e0 /crates/ra_parser/src/grammar/expressions.rs | |
parent | 7d3f48cdaf20d718e711f999573adf3303e9396a (diff) |
Allow attribute on struct literal field
Diffstat (limited to 'crates/ra_parser/src/grammar/expressions.rs')
-rw-r--r-- | crates/ra_parser/src/grammar/expressions.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/ra_parser/src/grammar/expressions.rs b/crates/ra_parser/src/grammar/expressions.rs index 70c71a8e1..647fedfb5 100644 --- a/crates/ra_parser/src/grammar/expressions.rs +++ b/crates/ra_parser/src/grammar/expressions.rs | |||
@@ -453,8 +453,13 @@ pub(crate) fn named_field_list(p: &mut Parser) { | |||
453 | p.bump(); | 453 | p.bump(); |
454 | while !p.at(EOF) && !p.at(R_CURLY) { | 454 | while !p.at(EOF) && !p.at(R_CURLY) { |
455 | match p.current() { | 455 | match p.current() { |
456 | IDENT => { | 456 | // test struct_literal_field_with_attr |
457 | // fn main() { | ||
458 | // S { #[cfg(test)] field: 1 } | ||
459 | // } | ||
460 | IDENT | POUND => { | ||
457 | let m = p.start(); | 461 | let m = p.start(); |
462 | attributes::outer_attributes(p); | ||
458 | name_ref(p); | 463 | name_ref(p); |
459 | if p.eat(COLON) { | 464 | if p.eat(COLON) { |
460 | expr(p); | 465 | expr(p); |