aboutsummaryrefslogtreecommitdiff
path: root/src/parser/grammar/items
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-02-11 09:58:32 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-02-11 09:58:32 +0000
commit7176029803fe2e00f29ab7d20a384e3ee6f53ba3 (patch)
tree51e7251231162d5d31b6e18fabdbb466ffb94d19 /src/parser/grammar/items
parente19d038a0e1d9af8270450c5fe8fbbdf0f15cb24 (diff)
parent96437b050f2743fef2e37eaab7259f2f98f9b473 (diff)
Merge #48
48: Types r=matklad a=matklad bors r+
Diffstat (limited to 'src/parser/grammar/items')
-rw-r--r--src/parser/grammar/items/consts.rs2
-rw-r--r--src/parser/grammar/items/mod.rs19
-rw-r--r--src/parser/grammar/items/structs.rs4
3 files changed, 4 insertions, 21 deletions
diff --git a/src/parser/grammar/items/consts.rs b/src/parser/grammar/items/consts.rs
index 5f3cf58c2..d6c3753b3 100644
--- a/src/parser/grammar/items/consts.rs
+++ b/src/parser/grammar/items/consts.rs
@@ -14,7 +14,7 @@ fn const_or_static(p: &mut Parser, kw: SyntaxKind) {
14 p.eat(MUT_KW); // TODO: validator to forbid const mut 14 p.eat(MUT_KW); // TODO: validator to forbid const mut
15 name(p); 15 name(p);
16 p.expect(COLON); 16 p.expect(COLON);
17 types::ty(p); 17 types::type_(p);
18 p.expect(EQ); 18 p.expect(EQ);
19 expressions::expr(p); 19 expressions::expr(p);
20 p.expect(SEMI); 20 p.expect(SEMI);
diff --git a/src/parser/grammar/items/mod.rs b/src/parser/grammar/items/mod.rs
index f1776e0e2..18ee8af86 100644
--- a/src/parser/grammar/items/mod.rs
+++ b/src/parser/grammar/items/mod.rs
@@ -222,12 +222,6 @@ fn fn_item(p: &mut Parser) {
222 p.expect(L_CURLY); 222 p.expect(L_CURLY);
223 p.expect(R_CURLY); 223 p.expect(R_CURLY);
224 } 224 }
225
226 fn fn_value_parameters(p: &mut Parser) {
227 assert!(p.at(L_PAREN));
228 p.bump();
229 p.expect(R_PAREN);
230 }
231} 225}
232 226
233// test type_item 227// test type_item
@@ -247,7 +241,7 @@ fn type_item(p: &mut Parser) {
247 type_params::where_clause(p); 241 type_params::where_clause(p);
248 242
249 p.expect(EQ); 243 p.expect(EQ);
250 types::ty(p); 244 types::type_(p);
251 p.expect(SEMI); 245 p.expect(SEMI);
252} 246}
253 247
@@ -263,14 +257,3 @@ fn mod_item(p: &mut Parser) {
263 } 257 }
264 } 258 }
265} 259}
266
267fn abi(p: &mut Parser) {
268 assert!(p.at(EXTERN_KW));
269 let abi = p.start();
270 p.bump();
271 match p.current() {
272 STRING | RAW_STRING => p.bump(),
273 _ => (),
274 }
275 abi.complete(p, ABI);
276}
diff --git a/src/parser/grammar/items/structs.rs b/src/parser/grammar/items/structs.rs
index ad18fd270..c72b50808 100644
--- a/src/parser/grammar/items/structs.rs
+++ b/src/parser/grammar/items/structs.rs
@@ -89,7 +89,7 @@ fn named_fields(p: &mut Parser) {
89 if p.at(IDENT) { 89 if p.at(IDENT) {
90 name(p); 90 name(p);
91 p.expect(COLON); 91 p.expect(COLON);
92 types::ty(p); 92 types::type_(p);
93 field.complete(p, NAMED_FIELD); 93 field.complete(p, NAMED_FIELD);
94 } else { 94 } else {
95 field.abandon(p); 95 field.abandon(p);
@@ -105,7 +105,7 @@ fn pos_fields(p: &mut Parser) {
105 while !p.at(R_PAREN) && !p.at(EOF) { 105 while !p.at(R_PAREN) && !p.at(EOF) {
106 let pos_field = p.start(); 106 let pos_field = p.start();
107 visibility(p); 107 visibility(p);
108 types::ty(p); 108 types::type_(p);
109 pos_field.complete(p, POS_FIELD); 109 pos_field.complete(p, POS_FIELD);
110 110
111 if !p.at(R_PAREN) { 111 if !p.at(R_PAREN) {