From fc0a9e266b9d663b1eeca3963495c68ca3384be2 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 10 Feb 2018 14:00:23 +0300 Subject: G: introduce names --- src/parser/grammar/items/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/parser/grammar/items/mod.rs') diff --git a/src/parser/grammar/items/mod.rs b/src/parser/grammar/items/mod.rs index ffe86fa97..d671568b1 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) { p.bump(); assert!(p.at(CRATE_KW)); p.bump(); - - p.expect(IDENT) && alias(p) && p.expect(SEMI); + name(p); + alias(p); + p.expect(SEMI); } fn extern_block(p: &mut Parser) { -- cgit v1.2.3 From 3c9d8ff42357711775c3aeb3af03f528ee779932 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 10 Feb 2018 14:04:31 +0300 Subject: G: names for fns --- src/parser/grammar/items/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/parser/grammar/items/mod.rs') diff --git a/src/parser/grammar/items/mod.rs b/src/parser/grammar/items/mod.rs index d671568b1..61ebc740f 100644 --- a/src/parser/grammar/items/mod.rs +++ b/src/parser/grammar/items/mod.rs @@ -211,7 +211,7 @@ fn fn_item(p: &mut Parser) { assert!(p.at(FN_KW)); p.bump(); - p.expect(IDENT); + name(p); if p.at(L_PAREN) { fn_value_parameters(p); } else { -- cgit v1.2.3 From d68a187eb5adf489b5e1eef6aa23768b819d0e65 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 10 Feb 2018 14:22:31 +0300 Subject: G: use name in types --- src/parser/grammar/items/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/parser/grammar/items/mod.rs') diff --git a/src/parser/grammar/items/mod.rs b/src/parser/grammar/items/mod.rs index 61ebc740f..2d9580991 100644 --- a/src/parser/grammar/items/mod.rs +++ b/src/parser/grammar/items/mod.rs @@ -236,7 +236,7 @@ fn type_item(p: &mut Parser) { assert!(p.at(TYPE_KW)); p.bump(); - p.expect(IDENT); + name(p); // test type_item_type_params // type Result = (); -- cgit v1.2.3 From 199b3a1604095beee9eaeec541c8f158e85493ea Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 10 Feb 2018 14:23:18 +0300 Subject: G: use name in mods --- src/parser/grammar/items/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/parser/grammar/items/mod.rs') diff --git a/src/parser/grammar/items/mod.rs b/src/parser/grammar/items/mod.rs index 2d9580991..8bb821fb6 100644 --- a/src/parser/grammar/items/mod.rs +++ b/src/parser/grammar/items/mod.rs @@ -255,7 +255,8 @@ fn mod_item(p: &mut Parser) { assert!(p.at(MOD_KW)); p.bump(); - if p.expect(IDENT) && !p.eat(SEMI) { + name(p); + if !p.eat(SEMI) { if p.expect(L_CURLY) { mod_contents(p, true); p.expect(R_CURLY); -- cgit v1.2.3