diff options
| author | Phil Schaf | 2015-11-14 20:13:45 +0100 |
|---|---|---|
| committer | Phil Schaf | 2015-11-14 20:13:45 +0100 |
| commit | 5fdb21df228c78061cce9ee910fa87da0fd99d46 (patch) | |
| tree | 707d234259202381be0c784e8f1efea8eb5081ec /src/document_tree/mod.rs | |
| parent | 9c2f818b7e7139ed7a5da573d1cc104defa7579f (diff) | |
| download | rust-rst-5fdb21df228c78061cce9ee910fa87da0fd99d46.tar.bz2 | |
redesign
Diffstat (limited to 'src/document_tree/mod.rs')
| -rw-r--r-- | src/document_tree/mod.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/document_tree/mod.rs b/src/document_tree/mod.rs new file mode 100644 index 0000000..868b9f8 --- /dev/null +++ b/src/document_tree/mod.rs @@ -0,0 +1,21 @@ +///http://docutils.sourceforge.net/docs/ref/doctree.html +///serves as AST + +pub mod elements; +pub mod element_categories; +pub mod extra_attributes; +pub mod attribute_types; + +use self::element_categories::StructuralSubElement; + +pub use self::elements::*; //Element,CommonAttributes, +pub use self::extra_attributes::ExtraAttributes; +pub use self::element_categories::HasChildren; + +#[derive(Default,Debug)] +pub struct Document { children: Vec<Box<StructuralSubElement>> } +impl HasChildren<StructuralSubElement> for Document { + fn add_child<R: Into<StructuralSubElement>>(&mut self, child: R) { + self.children.push(Box::new(child.into())); + } +} |
