aboutsummaryrefslogtreecommitdiff
path: root/src/parser/grammar/items/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser/grammar/items/mod.rs')
-rw-r--r--src/parser/grammar/items/mod.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/parser/grammar/items/mod.rs b/src/parser/grammar/items/mod.rs
index ffe86fa97..8bb821fb6 100644
--- a/src/parser/grammar/items/mod.rs
+++ b/src/parser/grammar/items/mod.rs
@@ -196,8 +196,9 @@ fn extern_crate_item(p: &mut Parser) {
196 p.bump(); 196 p.bump();
197 assert!(p.at(CRATE_KW)); 197 assert!(p.at(CRATE_KW));
198 p.bump(); 198 p.bump();
199 199 name(p);
200 p.expect(IDENT) && alias(p) && p.expect(SEMI); 200 alias(p);
201 p.expect(SEMI);
201} 202}
202 203
203fn extern_block(p: &mut Parser) { 204fn extern_block(p: &mut Parser) {
@@ -210,7 +211,7 @@ fn fn_item(p: &mut Parser) {
210 assert!(p.at(FN_KW)); 211 assert!(p.at(FN_KW));
211 p.bump(); 212 p.bump();
212 213
213 p.expect(IDENT); 214 name(p);
214 if p.at(L_PAREN) { 215 if p.at(L_PAREN) {
215 fn_value_parameters(p); 216 fn_value_parameters(p);
216 } else { 217 } else {
@@ -235,7 +236,7 @@ fn type_item(p: &mut Parser) {
235 assert!(p.at(TYPE_KW)); 236 assert!(p.at(TYPE_KW));
236 p.bump(); 237 p.bump();
237 238
238 p.expect(IDENT); 239 name(p);
239 240
240 // test type_item_type_params 241 // test type_item_type_params
241 // type Result<T> = (); 242 // type Result<T> = ();
@@ -254,7 +255,8 @@ fn mod_item(p: &mut Parser) {
254 assert!(p.at(MOD_KW)); 255 assert!(p.at(MOD_KW));
255 p.bump(); 256 p.bump();
256 257
257 if p.expect(IDENT) && !p.eat(SEMI) { 258 name(p);
259 if !p.eat(SEMI) {
258 if p.expect(L_CURLY) { 260 if p.expect(L_CURLY) {
259 mod_contents(p, true); 261 mod_contents(p, true);
260 p.expect(R_CURLY); 262 p.expect(R_CURLY);