diff --git a/crates/parser/src/ast/mod.rs b/crates/parser/src/ast/mod.rs index 23e9ce6..6a975df 100644 --- a/crates/parser/src/ast/mod.rs +++ b/crates/parser/src/ast/mod.rs @@ -18,19 +18,13 @@ pub struct Identifier(pub String); pub struct ParamList(pub Vec); #[derive(Debug, Clone, Serialize)] -pub struct TypeExpr(pub TypeExprKind, pub Vec); - -#[derive(Debug, Clone, Serialize)] -pub enum TypePostfix { - Ref, - RefMut, - RefLifetime(Identifier), - RefMutLifetime(Identifier), - Dyn, -} - -#[derive(Debug, Clone, Serialize)] -pub enum TypeExprKind { +pub enum TypeExpr { + Ref { + lifetime: Option, + mutable: bool, + ty: Box, + }, + Dyn(Box), Path(Path, Option), Tuple(Vec), Lifetime(Identifier), @@ -43,20 +37,11 @@ pub struct Spanned { pub item: T, } -impl TypeExpr { - pub fn no_px(kind: TypeExprKind) -> Self { - Self(kind, Vec::new()) - } -} - impl From for Generic { fn from(value: GenericDecl) -> Self { match value { GenericDecl::Lifetime(life) => Generic::Lifetime(life), - GenericDecl::Type(ty, _) => Generic::Type(TypeExpr( - TypeExprKind::Path(Path(vec![ty]), None), - Vec::new(), - )), + GenericDecl::Type(ty, _) => Generic::Type(TypeExpr::Path(Path(vec![ty]), None)), } } } diff --git a/mist-test/src/main.mist b/mist-test/src/main.mist index 05a37e9..d8b71aa 100644 --- a/mist-test/src/main.mist +++ b/mist-test/src/main.mist @@ -1 +1 @@ -void main() {} \ No newline at end of file +*void main() {} \ No newline at end of file