feat: Add support for function declarations.

This commit is contained in:
Jooris Hadeler
2026-01-16 21:17:53 +01:00
parent fbf6726a78
commit 4815f6cd3a
4 changed files with 106 additions and 5 deletions

View File

@@ -103,3 +103,21 @@ pub enum Type {
Named { name: Box<str>, name_span: Span },
}
#[derive(Debug, PartialEq, Eq)]
pub enum Declaration {
Function {
name: Box<str>,
name_span: Span,
parameters: Vec<Parameter>,
return_type: Option<Type>,
body: Option<Statement>,
},
}
#[derive(Debug, PartialEq, Eq)]
pub struct Parameter {
pub name: Box<str>,
pub name_span: Span,
pub type_: Type,
}