Improve const generics parsing

- Handle const generics type args
- Fix issue with const generic as first parameter in trait impl
This commit is contained in:
Michael Chesser 2020-01-07 09:29:03 +10:30
parent c92a090f49
commit ce1b34fd59
9 changed files with 123 additions and 21 deletions

View file

@ -206,6 +206,7 @@ pub(crate) const KINDS_SRC: KindsSrc = KindsSrc {
"LIFETIME_ARG",
"TYPE_ARG",
"ASSOC_TYPE_ARG",
"CONST_ARG",
"PARAM_LIST",
"PARAM",
"SELF_PARAM",
@ -511,10 +512,12 @@ pub(crate) const AST_SRC: AstSrc = AstSrc {
type_args: [TypeArg],
lifetime_args: [LifetimeArg],
assoc_type_args: [AssocTypeArg],
const_arg: [ConstArg],
}
struct TypeArg { TypeRef }
struct AssocTypeArg { NameRef, TypeRef }
struct LifetimeArg {}
struct ConstArg { Literal, BlockExpr }
struct MacroItems: ModuleItemOwner, FnDefOwner { }