aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-06-02 04:08:07 +0000
committerFuwn <[email protected]>2022-06-02 04:08:07 +0000
commit4ec58d54486f89f329365b715198910abaa08fc1 (patch)
treec79f4be1ef309ef3bc04c3fe6d2d58825980b84a
parentfeat(germ): ast struct (diff)
downloadgerm-4ec58d54486f89f329365b715198910abaa08fc1.tar.xz
germ-4ec58d54486f89f329365b715198910abaa08fc1.zip
docs(ast): add comment to ast struct
-rw-r--r--src/ast.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ast.rs b/src/ast.rs
index 8300f0e..f432666 100644
--- a/src/ast.rs
+++ b/src/ast.rs
@@ -174,6 +174,13 @@ pub enum Node {
Whitespace,
}
+/// An AST structure which contains an AST tree
+///
+/// # Example
+///
+/// ```rust
+/// let _ = germ::ast::Ast::from_string(r#"=> gemini://gem.rest/ GemRest"#);
+/// ```
pub struct Ast {
inner: Vec<Node>,
}
@@ -213,8 +220,8 @@ impl Ast {
/// # Example
///
/// ```rust
- ///
- /// let _ = germ::ast::Ast::from_string(r#"=> gemini://gem.rest/ GemRest"#).inner();
+ /// let _ =
+ /// germ::ast::Ast::from_string(r#"=> gemini://gem.rest/ GemRest"#).inner();
/// ```
#[must_use]
pub const fn inner(&self) -> &Vec<Node> { &self.inner }