ParseResultM
-> ModeResultM
This commit is contained in:
parent
2de2ecc07d
commit
9d9c86033a
@ -34,8 +34,8 @@ pub use self::inctx::InCtx;
|
|||||||
pub use self::inlining::{Inlining, InliningExt, InliningResultExt};
|
pub use self::inlining::{Inlining, InliningExt, InliningResultExt};
|
||||||
pub use self::modes::{
|
pub use self::modes::{
|
||||||
ExtensionResult, ExtensionResultM, ExtensionResultP, ExtensionSource, ExtensionSourceM,
|
ExtensionResult, ExtensionResultM, ExtensionResultP, ExtensionSource, ExtensionSourceM,
|
||||||
ExtensionSourceP, FactoryModeParse, FactoryModeProxy, ImplMode, Mode, ModeResult, ModeResultP,
|
ExtensionSourceP, FactoryModeParse, FactoryModeProxy, ImplMode, Mode, ModeResult, ModeResultM,
|
||||||
ParseMode, ParseModeExt, ParseResultM, ParseSuccess, ParseSuccessP, QRegularFactory,
|
ModeResultP, ParseMode, ParseModeExt, ParseSuccess, ParseSuccessP, QRegularFactory,
|
||||||
RegularFactory, RegularMode, WithMode, WithParseMode,
|
RegularFactory, RegularMode, WithMode, WithParseMode,
|
||||||
};
|
};
|
||||||
pub use self::origin::{OFctr, Origin};
|
pub use self::origin::{OFctr, Origin};
|
||||||
|
@ -241,15 +241,18 @@ where
|
|||||||
type _Mtbl = Self::Mtbl;
|
type _Mtbl = Self::Mtbl;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type ParseResultM<'a, Ctx, F, I> = ModeResultP<F, Mtbl<'a, Ctx, F>, ParseError<'a, Ctx, F>, I>;
|
/// [`FactoryParse`] equivalent of [`ModeResult`].
|
||||||
|
pub type ModeResultM<'a, Ctx, F, I> = ModeResultP<F, Mtbl<'a, Ctx, F>, ParseError<'a, Ctx, F>, I>;
|
||||||
|
|
||||||
|
/// [`FactoryParse`] equivalent of [`ExtensionResult`].
|
||||||
pub type ExtensionResultM<'a, Ctx, F> =
|
pub type ExtensionResultM<'a, Ctx, F> =
|
||||||
ExtensionResultP<F, Mtbl<'a, Ctx, F>, ParseError<'a, Ctx, F>>;
|
ExtensionResultP<F, Mtbl<'a, Ctx, F>, ParseError<'a, Ctx, F>>;
|
||||||
|
|
||||||
|
/// [`FactoryParse`] equivalent of [`ExtensionSource`].
|
||||||
pub type ExtensionSourceM<'a, Ctx, F> = ExtensionSourceP<F, Mtbl<'a, Ctx, F>>;
|
pub type ExtensionSourceM<'a, Ctx, F> = ExtensionSourceP<F, Mtbl<'a, Ctx, F>>;
|
||||||
|
|
||||||
pub trait FactoryModeParse<'a, Ctx: Context<'a>>: FactoryBase<'a, Ctx> + ParseMode {
|
pub trait FactoryModeParse<'a, Ctx: Context<'a>>: FactoryBase<'a, Ctx> + ParseMode {
|
||||||
fn mdeserialize<I: InCtx<'a, Ctx>>(&self, inctx: I) -> ParseResultM<'a, Ctx, Self, I>;
|
fn mdeserialize<I: InCtx<'a, Ctx>>(&self, inctx: I) -> ModeResultM<'a, Ctx, Self, I>;
|
||||||
|
|
||||||
fn mextend(
|
fn mextend(
|
||||||
&self,
|
&self,
|
||||||
@ -261,8 +264,7 @@ pub trait FactoryModeParse<'a, Ctx: Context<'a>>: FactoryBase<'a, Ctx> + ParseMo
|
|||||||
pub trait FactoryModeProxy<'a, Ctx: Context<'a>> {
|
pub trait FactoryModeProxy<'a, Ctx: Context<'a>> {
|
||||||
type F: FactoryBase<'a, Ctx> + ParseMode;
|
type F: FactoryBase<'a, Ctx> + ParseMode;
|
||||||
|
|
||||||
fn pmdeserialize<I: InCtx<'a, Ctx>>(f: &Self::F, inctx: I)
|
fn pmdeserialize<I: InCtx<'a, Ctx>>(f: &Self::F, inctx: I) -> ModeResultM<'a, Ctx, Self::F, I>;
|
||||||
-> ParseResultM<'a, Ctx, Self::F, I>;
|
|
||||||
|
|
||||||
fn pmextend(
|
fn pmextend(
|
||||||
f: &Self::F,
|
f: &Self::F,
|
||||||
@ -275,7 +277,7 @@ impl<'a, Ctx: Context<'a>, F: FactoryBase<'a, Ctx> + WithParseMode> FactoryModeP
|
|||||||
where
|
where
|
||||||
F::WithMode: FactoryModeProxy<'a, Ctx, F = F>,
|
F::WithMode: FactoryModeProxy<'a, Ctx, F = F>,
|
||||||
{
|
{
|
||||||
fn mdeserialize<I: InCtx<'a, Ctx>>(&self, inctx: I) -> ParseResultM<'a, Ctx, Self, I> {
|
fn mdeserialize<I: InCtx<'a, Ctx>>(&self, inctx: I) -> ModeResultM<'a, Ctx, Self, I> {
|
||||||
<F::WithMode as FactoryModeProxy<'a, Ctx>>::pmdeserialize(self, inctx)
|
<F::WithMode as FactoryModeProxy<'a, Ctx>>::pmdeserialize(self, inctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -386,7 +388,7 @@ impl<'a, Ctx: Context<'a>, F: QRegularFactory<'a, Ctx>> FactoryModeProxy<'a, Ctx
|
|||||||
{
|
{
|
||||||
type F = F;
|
type F = F;
|
||||||
|
|
||||||
fn pmdeserialize<I: InCtx<'a, Ctx>>(f: &Self::F, inctx: I) -> ParseResultM<'a, Ctx, F, I> {
|
fn pmdeserialize<I: InCtx<'a, Ctx>>(f: &Self::F, inctx: I) -> ModeResultM<'a, Ctx, F, I> {
|
||||||
f.qrdeserialize(inctx)
|
f.qrdeserialize(inctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ impl<A: ParseMode> ParseMode for AtomicFactory<A> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, Ctx: Context<'a>, A: AtomicModeParse> FactoryModeParse<'a, Ctx> for AtomicFactory<A> {
|
impl<'a, Ctx: Context<'a>, A: AtomicModeParse> FactoryModeParse<'a, Ctx> for AtomicFactory<A> {
|
||||||
fn mdeserialize<I: InCtx<'a, Ctx>>(&self, inctx: I) -> ParseResultM<'a, Ctx, Self, I> {
|
fn mdeserialize<I: InCtx<'a, Ctx>>(&self, inctx: I) -> ModeResultM<'a, Ctx, Self, I> {
|
||||||
A::ma_deserialize(inctx).map(|a| Self::map(a, From::from))
|
A::ma_deserialize(inctx).map(|a| Self::map(a, From::from))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ impl<'a, Ctx: Context<'a>, F: QInliningFactory<'a, Ctx>> FactoryModeProxy<'a, Ct
|
|||||||
{
|
{
|
||||||
type F = F;
|
type F = F;
|
||||||
|
|
||||||
fn pmdeserialize<I: InCtx<'a, Ctx>>(f: &Self::F, inctx: I) -> ParseResultM<'a, Ctx, F, I> {
|
fn pmdeserialize<I: InCtx<'a, Ctx>>(f: &Self::F, inctx: I) -> ModeResultM<'a, Ctx, F, I> {
|
||||||
f.qideserialize(inctx)
|
f.qideserialize(inctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ impl<'a, Ctx: Context<'a>, SP: StaticPair<'a, Ctx>> FactoryModeParse<'a, Ctx>
|
|||||||
where
|
where
|
||||||
SP::FB: FactoryModeParse<'a, Ctx>,
|
SP::FB: FactoryModeParse<'a, Ctx>,
|
||||||
{
|
{
|
||||||
fn mdeserialize<I: InCtx<'a, Ctx>>(&self, inctx: I) -> ParseResultM<'a, Ctx, Self, I> {
|
fn mdeserialize<I: InCtx<'a, Ctx>>(&self, inctx: I) -> ModeResultM<'a, Ctx, Self, I> {
|
||||||
let (fa, fb) = SP::factories(&self.factory_data);
|
let (fa, fb) = SP::factories(&self.factory_data);
|
||||||
let (a, inctx) = fa
|
let (a, inctx) = fa
|
||||||
.ideserialize(inctx)
|
.ideserialize(inctx)
|
||||||
|
Loading…
Reference in New Issue
Block a user