aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar/items/adt.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_parser/src/grammar/items/adt.rs')
-rw-r--r--crates/ra_parser/src/grammar/items/adt.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/ra_parser/src/grammar/items/adt.rs b/crates/ra_parser/src/grammar/items/adt.rs
index 74b9f514b..addfb59d4 100644
--- a/crates/ra_parser/src/grammar/items/adt.rs
+++ b/crates/ra_parser/src/grammar/items/adt.rs
@@ -5,13 +5,13 @@ use super::*;
5pub(super) fn struct_def(p: &mut Parser, m: Marker) { 5pub(super) fn struct_def(p: &mut Parser, m: Marker) {
6 assert!(p.at(T![struct])); 6 assert!(p.at(T![struct]));
7 p.bump(T![struct]); 7 p.bump(T![struct]);
8 struct_or_union(p, m, T![struct], STRUCT_DEF); 8 struct_or_union(p, m, T![struct], STRUCT);
9} 9}
10 10
11pub(super) fn union_def(p: &mut Parser, m: Marker) { 11pub(super) fn union_def(p: &mut Parser, m: Marker) {
12 assert!(p.at_contextual_kw("union")); 12 assert!(p.at_contextual_kw("union"));
13 p.bump_remap(T![union]); 13 p.bump_remap(T![union]);
14 struct_or_union(p, m, T![union], UNION_DEF); 14 struct_or_union(p, m, T![union], UNION);
15} 15}
16 16
17fn struct_or_union(p: &mut Parser, m: Marker, kw: SyntaxKind, def: SyntaxKind) { 17fn struct_or_union(p: &mut Parser, m: Marker, kw: SyntaxKind, def: SyntaxKind) {
@@ -64,7 +64,7 @@ pub(super) fn enum_def(p: &mut Parser, m: Marker) {
64 } else { 64 } else {
65 p.error("expected `{`") 65 p.error("expected `{`")
66 } 66 }
67 m.complete(p, ENUM_DEF); 67 m.complete(p, ENUM);
68} 68}
69 69
70pub(crate) fn enum_variant_list(p: &mut Parser) { 70pub(crate) fn enum_variant_list(p: &mut Parser) {
@@ -91,7 +91,7 @@ pub(crate) fn enum_variant_list(p: &mut Parser) {
91 if p.eat(T![=]) { 91 if p.eat(T![=]) {
92 expressions::expr(p); 92 expressions::expr(p);
93 } 93 }
94 var.complete(p, ENUM_VARIANT); 94 var.complete(p, VARIANT);
95 } else { 95 } else {
96 var.abandon(p); 96 var.abandon(p);
97 p.err_and_bump("expected enum variant"); 97 p.err_and_bump("expected enum variant");
@@ -101,7 +101,7 @@ pub(crate) fn enum_variant_list(p: &mut Parser) {
101 } 101 }
102 } 102 }
103 p.expect(T!['}']); 103 p.expect(T!['}']);
104 m.complete(p, ENUM_VARIANT_LIST); 104 m.complete(p, VARIANT_LIST);
105} 105}
106 106
107pub(crate) fn record_field_def_list(p: &mut Parser) { 107pub(crate) fn record_field_def_list(p: &mut Parser) {
@@ -119,7 +119,7 @@ pub(crate) fn record_field_def_list(p: &mut Parser) {
119 } 119 }
120 } 120 }
121 p.expect(T!['}']); 121 p.expect(T!['}']);
122 m.complete(p, RECORD_FIELD_DEF_LIST); 122 m.complete(p, RECORD_FIELD_LIST);
123 123
124 fn record_field_def(p: &mut Parser) { 124 fn record_field_def(p: &mut Parser) {
125 let m = p.start(); 125 let m = p.start();
@@ -134,7 +134,7 @@ pub(crate) fn record_field_def_list(p: &mut Parser) {
134 name(p); 134 name(p);
135 p.expect(T![:]); 135 p.expect(T![:]);
136 types::type_(p); 136 types::type_(p);
137 m.complete(p, RECORD_FIELD_DEF); 137 m.complete(p, RECORD_FIELD);
138 } else { 138 } else {
139 m.abandon(p); 139 m.abandon(p);
140 p.err_and_bump("expected field declaration"); 140 p.err_and_bump("expected field declaration");
@@ -167,12 +167,12 @@ fn tuple_field_def_list(p: &mut Parser) {
167 break; 167 break;
168 } 168 }
169 types::type_(p); 169 types::type_(p);
170 m.complete(p, TUPLE_FIELD_DEF); 170 m.complete(p, TUPLE_FIELD);
171 171
172 if !p.at(T![')']) { 172 if !p.at(T![')']) {
173 p.expect(T![,]); 173 p.expect(T![,]);
174 } 174 }
175 } 175 }
176 p.expect(T![')']); 176 p.expect(T![')']);
177 m.complete(p, TUPLE_FIELD_DEF_LIST); 177 m.complete(p, TUPLE_FIELD_LIST);
178} 178}