Function types
This commit is contained in:
@@ -17,6 +17,15 @@ pub struct Identifier(pub String);
|
||||
#[derive(Debug, Clone, Serialize, Default)]
|
||||
pub struct ParamList(pub Vec<VarDecl>);
|
||||
|
||||
#[derive(Debug, Clone, Serialize, PartialEq, Eq, Hash)]
|
||||
pub enum FnKind {
|
||||
Fn,
|
||||
UnsafeFn,
|
||||
FnClosure,
|
||||
FnOnce,
|
||||
FnMut,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, PartialEq, Eq, Hash)]
|
||||
pub enum TypeExpr {
|
||||
Ref {
|
||||
@@ -33,6 +42,11 @@ pub enum TypeExpr {
|
||||
StaticFn(Vec<TypeExpr>, Option<Box<TypeExpr>>),
|
||||
Tuple(Vec<TypeExpr>),
|
||||
Lifetime(Identifier),
|
||||
Fn {
|
||||
kind: FnKind,
|
||||
return_type: Box<TypeExpr>,
|
||||
params: Vec<TypeExpr>,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
|
||||
Reference in New Issue
Block a user