Impl for
This commit is contained in:
@@ -303,6 +303,15 @@ impl From<pest::iterators::Pair<'_, Rule>> for TopLevelKind {
|
||||
|
||||
Rule::mod_package => TopLevelKind::Mod(Identifier::from(inner.next().unwrap())),
|
||||
|
||||
Rule::impl_for_decl => TopLevelKind::ImplDecl(ImplDecl {
|
||||
generics: consume_rule(&mut inner, Rule::generics)
|
||||
.map(Generics::from)
|
||||
.unwrap_or_default(),
|
||||
trait_: Some(TypeExpr::from(inner.next().unwrap())),
|
||||
target: TypeExpr::from(inner.next().unwrap()),
|
||||
methods: inner.map(FunctionDecl::from).collect(),
|
||||
}),
|
||||
|
||||
_ => unimplemented!("{rule:#?}"),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user