| 1 | use crate::parser::extset::RootExtSet; |
| 2 | use crate::{Node, NodeValue, Renderer}; |
| 3 | |
| 4 | #[derive(Debug)] |
| 5 | /// Root node of the AST. |
| 6 | pub struct Root { |
| 7 | pub content: String, |
| 8 | pub ext: RootExtSet, |
| 9 | } |
| 10 | |
| 11 | impl Root { |
| 12 | pub fn new(content: String) -> Self { |
| 13 | Self { content, ext: RootExtSet::new() } |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | impl NodeValue for Root { |
| 18 | fn render(&self, node: &Node, fmt: &mut dyn Renderer) { |
| 19 | fmt.contents(&node.children); |
| 20 | } |
| 21 | } |