use super::Span;
#[derive(Debug, Clone, PartialEq)]
pub enum TypeExpr {
Primitive(PrimitiveType),
Named(String),
Ref(Box<TypeExpr>),
Mref(Box<TypeExpr>),
Raw(Box<TypeExpr>),
Rawm(Box<TypeExpr>),
Own(Box<TypeExpr>),
Slice(Box<TypeExpr>),
Arr(Box<TypeExpr>, Box<super::ConstExpr>),
Opt(Box<TypeExpr>),
Res(Box<TypeExpr>, Box<TypeExpr>),
Fn {
is_unsafe: bool,
params: Vec<TypeExpr>,
ret: Box<TypeExpr>,
},
Void,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum PrimitiveType {
I8,
I16,
I32,
I64,
U8,
U16,
U32,
U64,
F32,
F64,
Bool,
Usize,
Isize,
}
#[derive(Debug, Clone)]
pub struct SpannedType {
pub ty: TypeExpr,
pub span: Span,
}