diff options
Diffstat (limited to 'askama_parser/src/node.rs')
-rw-r--r-- | askama_parser/src/node.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/askama_parser/src/node.rs b/askama_parser/src/node.rs index 6a8899f..a76fdf0 100644 --- a/askama_parser/src/node.rs +++ b/askama_parser/src/node.rs @@ -35,6 +35,12 @@ pub enum Node<'a> { Continue(Ws), } +impl Node<'_> { + pub(super) fn parse<'i>(i: &'i str, s: &State<'_>) -> IResult<&'i str, Vec<Node<'i>>> { + parse_template(i, s) + } +} + #[derive(Debug, PartialEq)] pub enum Target<'a> { Name(&'a str), @@ -47,6 +53,12 @@ pub enum Target<'a> { Path(Vec<&'a str>), } +impl Target<'_> { + pub(super) fn parse(i: &str) -> IResult<&str, Target<'_>> { + target(i) + } +} + #[derive(Clone, Copy, Debug, PartialEq)] pub enum Whitespace { Preserve, @@ -101,18 +113,6 @@ pub struct CondTest<'a> { pub expr: Expr<'a>, } -impl Node<'_> { - pub(super) fn parse<'i>(i: &'i str, s: &State<'_>) -> IResult<&'i str, Vec<Node<'i>>> { - parse_template(i, s) - } -} - -impl Target<'_> { - pub(super) fn parse(i: &str) -> IResult<&str, Target<'_>> { - target(i) - } -} - fn expr_handle_ws(i: &str) -> IResult<&str, Whitespace> { alt((char('-'), char('+'), char('~')))(i).map(|(s, r)| (s, Whitespace::from(r))) } |