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 {