diff options
| author | Mel <einebeere@gmail.com> | 2021-10-20 22:15:08 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2021-10-20 22:15:08 +0200 |
| commit | a4980b8dbf1394c2b302f1de7c72d2264426b86e (patch) | |
| tree | 97160332c53d8036ea3f6865ff60dabb2c55ef49 /src/parse/ast/mod.rs | |
| parent | 8d5a74566beba45f4642838102c5a066ef2aa18d (diff) | |
| download | rabbithole-a4980b8dbf1394c2b302f1de7c72d2264426b86e.tar.zst rabbithole-a4980b8dbf1394c2b302f1de7c72d2264426b86e.zip | |
Statement parsing.
Diffstat (limited to 'src/parse/ast/mod.rs')
| -rw-r--r-- | src/parse/ast/mod.rs | 21 |
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(()) + } +} |
