oak-twig 0.0.11

Twig templating engine parser with support for modern template syntax and features.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#![doc = include_str!("readme.md")]
use core::range::Range;

/// Twig document root node
#[derive(Debug, Clone)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
/// Root node of a Twig AST.
pub struct TwigRoot {
    #[cfg_attr(feature = "serde", serde(with = "oak_core::serde_range"))]
    pub span: Range<usize>,
}

impl TwigRoot {
    pub fn new(span: Range<usize>) -> Self {
        Self { span }
    }
}