From 4ab81edda183784c633063ee38e0ed7a0935c157 Mon Sep 17 00:00:00 2001 From: numzero Date: Sat, 19 Apr 2025 11:07:27 +0300 Subject: [PATCH] fixup! Add Function to AST --- src/ast.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/ast.rs b/src/ast.rs index 37e0a15..b65f341 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -35,12 +35,15 @@ pub enum Expression { callee: Ident, args: Vec, }, - Function { - name: Option, - args: Vec, - body: Vec, - ret: Option>, - }, + Function(Function), +} + +#[derive(Debug, Clone, Default)] +pub struct Function { + pub name: Option, + pub args: Vec, + pub body: Vec, + pub ret: Option>, } #[derive(Debug, Clone, Default)]