Skip to main content

oak_bash/ast/
mod.rs

1#![doc = include_str!("readme.md")]
2/// Root node of the Bash syntax tree.
3#[derive(Debug, Clone)]
4pub struct BashRoot {
5    /// Elements in the syntax tree.
6    pub elements: Vec<Element>,
7}
8
9/// Element in the Bash syntax tree.
10#[derive(Debug, Clone)]
11pub enum Element {
12    /// Command.
13    Command(String),
14    /// Variable.
15    Variable(String),
16    /// String.
17    String(String),
18    /// Comment.
19    Comment(String),
20    /// Operator.
21    Operator(String),
22    /// Keyword.
23    Keyword(String),
24    /// Text.
25    Text(String),
26    /// Whitespace.
27    Whitespace(String),
28    /// Newline.
29    Newline,
30}