start item recovery

This commit is contained in:
Aleksey Kladov
2018-08-31 13:35:48 +03:00
parent faebae74e4
commit 8fc7f438c4
7 changed files with 40 additions and 9 deletions

View File

@@ -24,6 +24,10 @@ pub(super) enum ItemFlavor {
Mod, Trait
}
const ITEM_RECOVERY_SET: TokenSet =
token_set![FN_KW, STRUCT_KW, ENUM_KW, IMPL_KW, TRAIT_KW, CONST_KW, STATIC_KW, LET_KW,
MOD_KW, PUB_KW, CRATE_KW];
pub(super) fn item_or_macro(p: &mut Parser, stop_on_r_curly: bool, flavor: ItemFlavor) {
let m = p.start();
match maybe_item(p, flavor) {
@@ -231,7 +235,7 @@ fn fn_def(p: &mut Parser, flavor: ItemFlavor) {
assert!(p.at(FN_KW));
p.bump();
name(p);
name_r(p, ITEM_RECOVERY_SET);
// test function_type_params
// fn foo<T: Clone + Copy>(){}
type_params::opt_type_param_list(p);