aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar/items
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_parser/src/grammar/items')
-rw-r--r--crates/ra_parser/src/grammar/items/adt.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/crates/ra_parser/src/grammar/items/adt.rs b/crates/ra_parser/src/grammar/items/adt.rs
index c777bc9d0..74b9f514b 100644
--- a/crates/ra_parser/src/grammar/items/adt.rs
+++ b/crates/ra_parser/src/grammar/items/adt.rs
@@ -83,12 +83,14 @@ pub(crate) fn enum_variant_list(p: &mut Parser) {
83 match p.current() { 83 match p.current() {
84 T!['{'] => record_field_def_list(p), 84 T!['{'] => record_field_def_list(p),
85 T!['('] => tuple_field_def_list(p), 85 T!['('] => tuple_field_def_list(p),
86 T![=] => {
87 p.bump(T![=]);
88 expressions::expr(p);
89 }
90 _ => (), 86 _ => (),
91 } 87 }
88
89 // test variant_discriminant
90 // enum E { X(i32) = 10 }
91 if p.eat(T![=]) {
92 expressions::expr(p);
93 }
92 var.complete(p, ENUM_VARIANT); 94 var.complete(p, ENUM_VARIANT);
93 } else { 95 } else {
94 var.abandon(p); 96 var.abandon(p);