|
|
|
@ -33,7 +33,6 @@ pub enum DustTag<'a> {
|
|
|
|
|
DTNotExists(Container<'a>),
|
|
|
|
|
DTBlock(NamedBlock<'a>),
|
|
|
|
|
DTInlinePartial(NamedBlock<'a>),
|
|
|
|
|
DTPartial(Partial<'a>),
|
|
|
|
|
DTNewPartial(NewPartial<'a>),
|
|
|
|
|
DTHelperEquals(ParameterizedBlock<'a>),
|
|
|
|
|
DTHelperNotEquals(ParameterizedBlock<'a>),
|
|
|
|
@ -119,12 +118,6 @@ pub struct NewPartial<'a> {
|
|
|
|
|
pub params: Vec<KVPair<'a>>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, PartialEq)]
|
|
|
|
|
pub struct Partial<'a> {
|
|
|
|
|
pub name: String,
|
|
|
|
|
pub params: Vec<KVPair<'a>>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, PartialEq)]
|
|
|
|
|
pub enum OwnedLiteral {
|
|
|
|
|
LString(String),
|
|
|
|
@ -610,37 +603,6 @@ where
|
|
|
|
|
move |i: &'a str| map(alt((&plain, "ed)), &constructor)(i)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn partial<'a, F>(
|
|
|
|
|
open_matcher: &'static str,
|
|
|
|
|
constructor: F,
|
|
|
|
|
) -> impl Fn(&'a str) -> IResult<&'a str, DustTag<'a>>
|
|
|
|
|
where
|
|
|
|
|
F: Fn(Partial<'a>) -> DustTag<'a>,
|
|
|
|
|
{
|
|
|
|
|
move |i: &'a str| {
|
|
|
|
|
let (i, (name, params)) = delimited(
|
|
|
|
|
tag(open_matcher),
|
|
|
|
|
tuple((
|
|
|
|
|
alt((map(key, String::from), quoted_string)),
|
|
|
|
|
opt(delimited(
|
|
|
|
|
space1,
|
|
|
|
|
separated_list1(space1, key_value_pair),
|
|
|
|
|
space0,
|
|
|
|
|
)),
|
|
|
|
|
)),
|
|
|
|
|
tag("/}"),
|
|
|
|
|
)(i)?;
|
|
|
|
|
|
|
|
|
|
Ok((
|
|
|
|
|
i,
|
|
|
|
|
constructor(Partial {
|
|
|
|
|
name: name,
|
|
|
|
|
params: params.unwrap_or(Vec::new()),
|
|
|
|
|
}),
|
|
|
|
|
))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn filter(i: &str) -> IResult<&str, Filter> {
|
|
|
|
|
preceded(
|
|
|
|
|
tag("|"),
|
|
|
|
|