Implement get and tap functions.

This commit is contained in:
Tom Alexander
2020-06-07 14:45:32 -04:00
parent 3ef2facc92
commit 3fb91566bb
3 changed files with 92 additions and 0 deletions

View File

@@ -41,6 +41,9 @@ pub enum DustTag<'a> {
DTHelperLessThan(ParameterizedBlock<'a>),
DTHelperGreaterThanOrEquals(ParameterizedBlock<'a>),
DTHelperLessThanOrEquals(ParameterizedBlock<'a>),
DTHelperSep(ParameterizedBlock<'a>),
DTHelperFirst(ParameterizedBlock<'a>),
DTHelperLast(ParameterizedBlock<'a>),
}
#[derive(Clone, Debug, PartialEq)]
@@ -240,6 +243,18 @@ fn dust_tag(i: &str) -> IResult<&str, DustTag> {
parameterized_block("{@", &tag_to_path("lt")),
DustTag::DTHelperLessThan,
),
map(
parameterized_block("{@", &tag_to_path("sep")),
DustTag::DTHelperSep,
),
map(
parameterized_block("{@", &tag_to_path("first")),
DustTag::DTHelperFirst,
),
map(
parameterized_block("{@", &tag_to_path("last")),
DustTag::DTHelperLast,
),
))(i)
}