loosen stack bounds
This commit is contained in:
parent
0615c07e42
commit
886f6b2117
@ -6,7 +6,7 @@ use crate::rstd::external_points::*;
|
|||||||
use crate::rstd::{inlining::*, nullable::*, point::*, *};
|
use crate::rstd::{inlining::*, nullable::*, point::*, *};
|
||||||
|
|
||||||
/// Node containing a (nullable) reference to the next node and an element.
|
/// Node containing a (nullable) reference to the next node and an element.
|
||||||
pub struct StackNode<'a, Ctx: Context<'a>, A: StackCompatible<'a, Ctx>> {
|
pub struct StackNode<'a, Ctx: Context<'a>, A: MentionableBase<'a, Ctx>> {
|
||||||
/// Reference comes first due to being inlineable.
|
/// Reference comes first due to being inlineable.
|
||||||
pub rest: Stack<'a, Ctx, A>,
|
pub rest: Stack<'a, Ctx, A>,
|
||||||
/// Unlike the original implementation in Python, doesn't default to using Point.
|
/// Unlike the original implementation in Python, doesn't default to using Point.
|
||||||
@ -29,7 +29,7 @@ impl<F> StackNodeFactory<F> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, Ctx: Context<'a>, A: StackCompatible<'a, Ctx>> Serializable for StackNode<'a, Ctx, A> {
|
impl<'a, Ctx: Context<'a>, A: MentionableBase<'a, Ctx>> Serializable for StackNode<'a, Ctx, A> {
|
||||||
fn serialize(&self, serializer: &mut dyn Serializer) {
|
fn serialize(&self, serializer: &mut dyn Serializer) {
|
||||||
self.rest.serialize(serializer);
|
self.rest.serialize(serializer);
|
||||||
self.element.serialize(serializer);
|
self.element.serialize(serializer);
|
||||||
@ -90,7 +90,7 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, Ctx: Context<'a>, A: StackCompatible<'a, Ctx>> MentionableBase<'a, Ctx>
|
impl<'a, Ctx: Context<'a>, A: MentionableBase<'a, Ctx>> MentionableBase<'a, Ctx>
|
||||||
for StackNode<'a, Ctx, A>
|
for StackNode<'a, Ctx, A>
|
||||||
{
|
{
|
||||||
type Fctr = StackNodeFactory<A::Fctr>;
|
type Fctr = StackNodeFactory<A::Fctr>;
|
||||||
@ -148,10 +148,7 @@ impl<F> StackNodeFactory<F> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, Ctx: Context<'a>, F: Factory<'a, Ctx>> FactoryBase<'a, Ctx> for StackNodeFactory<F>
|
impl<'a, Ctx: Context<'a>, F: FactoryBase<'a, Ctx>> FactoryBase<'a, Ctx> for StackNodeFactory<F> {
|
||||||
where
|
|
||||||
F::Mtbl: StackCompatible<'a, Ctx>,
|
|
||||||
{
|
|
||||||
type Mtbl = StackNode<'a, Ctx, F::Mtbl>;
|
type Mtbl = StackNode<'a, Ctx, F::Mtbl>;
|
||||||
|
|
||||||
type ParseError = StackParseError<ParseError<'a, Ctx, F>>;
|
type ParseError = StackParseError<ParseError<'a, Ctx, F>>;
|
||||||
|
Loading…
Reference in New Issue
Block a user