about summary refs log tree commit diff
path: root/src/parse/ast/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse/ast/mod.rs')
-rw-r--r--src/parse/ast/mod.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/parse/ast/mod.rs b/src/parse/ast/mod.rs
new file mode 100644
index 0000000..257675f
--- /dev/null
+++ b/src/parse/ast/mod.rs
@@ -0,0 +1,21 @@
+use std::fmt::Display;
+
+use self::statement::Statement;
+
+pub mod expression;
+pub mod statement;
+pub mod value;
+
+#[derive(Debug)]
+pub struct Program {
+    pub statements: Vec<Statement>,
+}
+
+impl Display for Program {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        for statement in self.statements.iter() {
+            writeln!(f, "{}", statement)?;
+        }
+        Ok(())
+    }
+}