diff --git a/Cargo.toml b/Cargo.toml index 8ba95fe..2cdc178 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,4 +7,5 @@ edition = "2021" [dependencies] clap = { version = "4.4.8", features = ["derive"]} +derive_builder = "0.12.0" toml = "0.8.8" diff --git a/src/ast.rs b/src/ast.rs index 6907591..fd4f39a 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -41,6 +41,7 @@ impl ToString for BaseType { } } +#[derive(Builder)] pub struct Block { statements: Vec, } @@ -88,6 +89,7 @@ impl Expr for Literal { } } +#[derive(Builder)] pub struct Declaration { variable: Variable, assn: T, @@ -114,6 +116,7 @@ impl AstNode for Declaration {} impl Statement for Declaration {} +#[derive(Clone, Builder)] pub struct Variable { type_: BaseType, quantifer: Quantifier,