From a66c94af1bad3c2dcfd8dd4c07494d0cf6cc8b1b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 24 Aug 2018 02:14:10 +0300 Subject: renames --- crates/libsyntax2/src/grammar/items/mod.rs | 10 +++++----- crates/libsyntax2/src/grammar/items/structs.rs | 8 ++++---- crates/libsyntax2/src/grammar/items/traits.rs | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'crates/libsyntax2/src/grammar/items') diff --git a/crates/libsyntax2/src/grammar/items/mod.rs b/crates/libsyntax2/src/grammar/items/mod.rs index d460612b4..18b681ee2 100644 --- a/crates/libsyntax2/src/grammar/items/mod.rs +++ b/crates/libsyntax2/src/grammar/items/mod.rs @@ -225,7 +225,7 @@ fn function(p: &mut Parser, flavor: ItemFlavor) { name(p); // test function_type_params // fn foo(){} - type_params::type_param_list(p); + type_params::opt_type_param_list(p); if p.at(L_PAREN) { match flavor { @@ -240,11 +240,11 @@ fn function(p: &mut Parser, flavor: ItemFlavor) { // test function_ret_type // fn foo() {} // fn bar() -> () {} - fn_ret_type(p); + opt_fn_ret_type(p); // test function_where_clause // fn foo() where T: Copy {} - type_params::where_clause(p); + type_params::opt_where_clause(p); // test fn_decl // trait T { fn foo(); } @@ -263,7 +263,7 @@ fn type_def(p: &mut Parser) { // test type_item_type_params // type Result = (); - type_params::type_param_list(p); + type_params::opt_type_param_list(p); if p.at(COLON) { type_params::bounds(p); @@ -271,7 +271,7 @@ fn type_def(p: &mut Parser) { // test type_item_where_clause // type Foo where Foo: Copy = (); - type_params::where_clause(p); + type_params::opt_where_clause(p); if p.eat(EQ) { types::type_(p); diff --git a/crates/libsyntax2/src/grammar/items/structs.rs b/crates/libsyntax2/src/grammar/items/structs.rs index b3ed94fe3..cde9d0ae6 100644 --- a/crates/libsyntax2/src/grammar/items/structs.rs +++ b/crates/libsyntax2/src/grammar/items/structs.rs @@ -5,10 +5,10 @@ pub(super) fn struct_def(p: &mut Parser) { p.bump(); name(p); - type_params::type_param_list(p); + type_params::opt_type_param_list(p); match p.current() { WHERE_KW => { - type_params::where_clause(p); + type_params::opt_where_clause(p); match p.current() { SEMI => { p.bump(); @@ -42,8 +42,8 @@ pub(super) fn enum_def(p: &mut Parser) { assert!(p.at(ENUM_KW)); p.bump(); name(p); - type_params::type_param_list(p); - type_params::where_clause(p); + type_params::opt_type_param_list(p); + type_params::opt_where_clause(p); if p.expect(L_CURLY) { while !p.at(EOF) && !p.at(R_CURLY) { let var = p.start(); diff --git a/crates/libsyntax2/src/grammar/items/traits.rs b/crates/libsyntax2/src/grammar/items/traits.rs index daecaff5c..73ecd4bef 100644 --- a/crates/libsyntax2/src/grammar/items/traits.rs +++ b/crates/libsyntax2/src/grammar/items/traits.rs @@ -6,11 +6,11 @@ pub(super) fn trait_def(p: &mut Parser) { assert!(p.at(TRAIT_KW)); p.bump(); name(p); - type_params::type_param_list(p); + type_params::opt_type_param_list(p); if p.at(COLON) { type_params::bounds(p); } - type_params::where_clause(p); + type_params::opt_where_clause(p); p.expect(L_CURLY); // test trait_item_items // impl F { @@ -31,7 +31,7 @@ pub(super) fn impl_item(p: &mut Parser) { assert!(p.at(IMPL_KW)); p.bump(); if choose_type_params_over_qpath(p) { - type_params::type_param_list(p); + type_params::opt_type_param_list(p); } // TODO: never type @@ -44,7 +44,7 @@ pub(super) fn impl_item(p: &mut Parser) { if p.eat(FOR_KW) { types::type_(p); } - type_params::where_clause(p); + type_params::opt_where_clause(p); p.expect(L_CURLY); // test impl_item_items -- cgit v1.2.3