ma_extend_sp
This commit is contained in:
parent
6cff44c652
commit
a3de4c5fbe
@ -198,7 +198,7 @@ where
|
|||||||
// annotated to help rust-analyzer
|
// annotated to help rust-analyzer
|
||||||
Self::xsbind::<SP, _, _, _>(
|
Self::xsbind::<SP, _, _, _>(
|
||||||
mentionable,
|
mentionable,
|
||||||
|pair| pair.into_elements(),
|
SP::into_elements,
|
||||||
|b| Self::xmap_err(fb.mextend(b, tail), |e| SP::from_error_b(factory_data, e)),
|
|b| Self::xmap_err(fb.mextend(b, tail), |e| SP::from_error_b(factory_data, e)),
|
||||||
|a, b| SP::from_parsed(factory_data, a, b),
|
|a, b| SP::from_parsed(factory_data, a, b),
|
||||||
)
|
)
|
||||||
@ -296,6 +296,22 @@ where
|
|||||||
|b| SP::from_parsed(a, b),
|
|b| SP::from_parsed(a, b),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn ma_extend_sp(
|
||||||
|
atomic: ExtensionSourceP<Self, SP>,
|
||||||
|
tail: &[u8],
|
||||||
|
) -> ExtensionResultP<Self, SP, SP::AParseError> {
|
||||||
|
Self::xsbind(
|
||||||
|
atomic,
|
||||||
|
SP::into_elements,
|
||||||
|
|b| {
|
||||||
|
Self::xmap_err(<SP::B as AtomicModeParse>::ma_extend(b, tail), |e| {
|
||||||
|
SP::from_error_b(e)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|a, b| SP::from_parsed(a, b),
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<SP: StaticPairAtomic> AtomicModeParse for StaticPairObject<SP>
|
impl<SP: StaticPairAtomic> AtomicModeParse for StaticPairObject<SP>
|
||||||
@ -310,15 +326,9 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn ma_extend(atomic: AExtensionSourceM<Self>, tail: &[u8]) -> AExtensionResultM<Self> {
|
fn ma_extend(atomic: AExtensionSourceM<Self>, tail: &[u8]) -> AExtensionResultM<Self> {
|
||||||
Self::xsbind(
|
Self::xbind(
|
||||||
atomic,
|
Self::ma_extend_sp(Self::smap(atomic, |StaticPairObject { pair }| pair), tail),
|
||||||
|StaticPairObject { pair }| pair.into_elements(),
|
|pair| Ok(StaticPairObject { pair }),
|
||||||
|b| {
|
|
||||||
Self::xmap_err(<SP::B as AtomicModeParse>::ma_extend(b, tail), |e| {
|
|
||||||
SP::from_error_b(e)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|a, b| SP::from_parsed(a, b).map(|pair| StaticPairObject { pair }),
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user