From a4980b8dbf1394c2b302f1de7c72d2264426b86e Mon Sep 17 00:00:00 2001 From: Mel Date: Wed, 20 Oct 2021 22:15:08 +0200 Subject: Statement parsing. --- src/parse/ast/mod.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/parse/ast/mod.rs (limited to 'src/parse/ast/mod.rs') 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, +} + +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(()) + } +} -- cgit 1.4.1