ast: move typedef up
This commit is contained in:
22
src/ast.rs
22
src/ast.rs
@@ -114,6 +114,17 @@ pub enum PatOp {
|
||||
Alt,
|
||||
}
|
||||
|
||||
/// A record-type definition
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct Typedef(pub TypedefKind, pub Pat);
|
||||
|
||||
/// The type of type being defined
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub enum TypedefKind {
|
||||
Struct,
|
||||
Enum,
|
||||
}
|
||||
|
||||
/// A pattern binding
|
||||
/// ```ignore
|
||||
/// let Pat (= Expr (else Expr)?)?
|
||||
@@ -162,17 +173,6 @@ pub struct Make<A: Annotation = Span>(pub Anno<Expr<A>, A>, pub Vec<MakeArm<A>>)
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct MakeArm<A: Annotation = Span>(pub String, pub Option<Anno<Expr<A>, A>>);
|
||||
|
||||
/// A record-type definition
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct Typedef(pub TypedefKind, pub Pat);
|
||||
|
||||
/// The type of type being defined
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub enum TypedefKind {
|
||||
Struct,
|
||||
Enum,
|
||||
}
|
||||
|
||||
/// Expressions: The beating heart of Dough
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub enum Expr<A: Annotation = Span> {
|
||||
|
||||
Reference in New Issue
Block a user