From 608d89645e0f4f67646eeb3d3b00791b8fa40abd Mon Sep 17 00:00:00 2001 From: Jesse Brault Date: Mon, 15 Sep 2025 21:17:58 -0500 Subject: [PATCH] Add some Default impl. --- src/ast/mod.rs | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/ast/mod.rs b/src/ast/mod.rs index 6adff90..3386c9c 100644 --- a/src/ast/mod.rs +++ b/src/ast/mod.rs @@ -1,5 +1,47 @@ pub mod node { include!(concat!(env!("OUT_DIR"), "/src/ast/node.rs")); + + impl Default for Parameters { + fn default() -> Self { + Self::new(vec![]) + } + } + + impl Default for GenericParameters { + fn default() -> Self { + Self::new(Box::new(IdentifierList::new(vec![]))) + } + } + + impl Default for GenericArguments { + fn default() -> Self { + Self::new(Box::new(TypeUseList::new(vec![]))) + } + } + + impl Default for ImplementsList { + fn default() -> Self { + Self::new(vec![]) + } + } + + impl ReturnType { + pub fn void() -> Self { + Self::new(Box::new(TypeUse::PrimitiveType(PrimitiveType::Void))) + } + } + + impl Default for ClassConstructor { + fn default() -> Self { + Self::new(vec![]) + } + } + + impl Default for ClosureParameters { + fn default() -> Self { + Self::new(vec![]) + } + } } pub mod build {