ExternalPointsProxy

This commit is contained in:
AF 2023-07-29 10:11:42 +00:00
parent 0fa540f7aa
commit c595be270c

View File

@ -52,34 +52,30 @@ impl<
{ {
} }
pub trait StackCompatibleProxy<'a, Ctx: Context<'a>>: FactoryProxy<'a, Ctx> pub trait ExternalPointsProxy<'a, Ctx: Context<'a>, T>: FactoryProxy<'a, Ctx>
where where
Self::F: Factory<'a, Ctx>, Self::F: Factory<'a, Ctx>,
{ {
type T; fn exp_points_typed(stack: &T, points: &mut impl PointsVisitor<'a, Ctx>);
fn points_typed_rest(stack: &Self::T, points: &mut impl PointsVisitor<'a, Ctx>);
} }
impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx>> ExternalPoints<'a, Ctx, Stack<'a, Ctx, Self>> impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx>> ExternalPoints<'a, Ctx, Stack<'a, Ctx, Self>>
for A for A
where where
<Fctr<'a, Ctx, A> as WithParseMode>::WithMode: <Fctr<'a, Ctx, A> as WithParseMode>::WithMode:
StackCompatibleProxy<'a, Ctx, T = Stack<'a, Ctx, A>, F = Fctr<'a, Ctx, A>>, ExternalPointsProxy<'a, Ctx, Stack<'a, Ctx, A>, F = Fctr<'a, Ctx, A>>,
{ {
fn ex_points_typed(stack: &Stack<'a, Ctx, Self>, points: &mut impl PointsVisitor<'a, Ctx>) { fn ex_points_typed(stack: &Stack<'a, Ctx, Self>, points: &mut impl PointsVisitor<'a, Ctx>) {
<<Fctr<'a, Ctx, A> as WithParseMode>::WithMode as StackCompatibleProxy<'a, Ctx>>::points_typed_rest(stack, points) <<Fctr<'a, Ctx, A> as WithParseMode>::WithMode as ExternalPointsProxy<'a, Ctx, _>>::exp_points_typed(stack, points)
} }
} }
impl<'a, Ctx: Context<'a>, F: RegularFactory<'a, Ctx>> StackCompatibleProxy<'a, Ctx> impl<'a, Ctx: Context<'a>, F: RegularFactory<'a, Ctx>>
for WithMode<F, RegularMode> ExternalPointsProxy<'a, Ctx, Stack<'a, Ctx, Mtbl<'a, Ctx, F>>> for WithMode<F, RegularMode>
where where
F::Mtbl: MentionableTop<'a, Ctx>, F::Mtbl: MentionableTop<'a, Ctx>,
{ {
type T = Stack<'a, Ctx, Mtbl<'a, Ctx, F>>; fn exp_points_typed(
fn points_typed_rest(
stack: &Stack<'a, Ctx, Mtbl<'a, Ctx, Self::F>>, stack: &Stack<'a, Ctx, Mtbl<'a, Ctx, Self::F>>,
points: &mut impl PointsVisitor<'a, Ctx>, points: &mut impl PointsVisitor<'a, Ctx>,
) { ) {
@ -87,14 +83,12 @@ where
} }
} }
impl<'a, Ctx: Context<'a>, F: InlineableFactory<'a, Ctx>> StackCompatibleProxy<'a, Ctx> impl<'a, Ctx: Context<'a>, F: InlineableFactory<'a, Ctx>>
for WithMode<F, InliningMode> ExternalPointsProxy<'a, Ctx, Stack<'a, Ctx, Mtbl<'a, Ctx, F>>> for WithMode<F, InliningMode>
where where
F::Mtbl: MentionableTop<'a, Ctx>, F::Mtbl: MentionableTop<'a, Ctx>,
{ {
type T = Stack<'a, Ctx, Mtbl<'a, Ctx, F>>; fn exp_points_typed(
fn points_typed_rest(
stack: &Stack<'a, Ctx, Mtbl<'a, Ctx, Self::F>>, stack: &Stack<'a, Ctx, Mtbl<'a, Ctx, Self::F>>,
points: &mut impl PointsVisitor<'a, Ctx>, points: &mut impl PointsVisitor<'a, Ctx>,
) { ) {