use std::collections::HashMap; pub struct Ast { program: Vec, } pub enum Statement { Open(String), // TODO: parse into `OpenTree` Definition { is_public: bool, ident: String, generics: Vec, // TODO: refine definition_kind: crate::token::Kind, definition: Expression, }, Module { is_public: bool, ident: String, definition: Vec, }, Comment(String), // TODO: differentiate kinds } pub enum Expression { Function { args: Vec, // TODO: get more granular body: Vec, }, Application { function: Box, args: Vec, }, BinOp { operands: Box<(Expression, Expression)>, operator: Box, // TODO: refine? (maybe we _want_ arbitrary binary operators) }, Type(Vec), GenericSpecification(Vec), // TODO: refine } pub enum Type { Record(HashMap), // { red: u8, green: u8, blue: u8 } Tuple(Vec), // `Some (T) | None` Simple(String), // `Option::Some (T)` Empty, // `Option::None` }