use crate::parser::ast::{
declaration::generics::{GenericConstArg, GenericTypeArg},
declaration::visibility::Visibility,
expression::block::Block,
identifier::Identifier,
metadata::AstNodeMeta,
types::TypeInstantiation,
};
use super::where_clause::WhereClause;
#[derive(Debug)]
pub struct FunctionDeclaration<'src> {
pub meta: AstNodeMeta<'src>,
pub vis: Visibility<'src>,
pub is_dynamic: bool,
pub name: Identifier<'src>,
pub generic_type_args: Vec<GenericTypeArg<'src>>,
pub generic_constant_args: Vec<GenericConstArg<'src>>,
pub args: Vec<FunctionArg<'src>>,
pub return_type: Option<TypeInstantiation<'src>>,
pub where_clause: Option<WhereClause<'src>>,
pub body: Block<'src>,
}
#[derive(Debug)]
pub struct FunctionArg<'src> {
pub meta: AstNodeMeta<'src>,
pub name: Identifier<'src>,
pub ty: TypeInstantiation<'src>,
}