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,
|
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
|
/// A pattern binding
|
||||||
/// ```ignore
|
/// ```ignore
|
||||||
/// let Pat (= Expr (else Expr)?)?
|
/// 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)]
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
pub struct MakeArm<A: Annotation = Span>(pub String, pub Option<Anno<Expr<A>, A>>);
|
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
|
/// Expressions: The beating heart of Dough
|
||||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
pub enum Expr<A: Annotation = Span> {
|
pub enum Expr<A: Annotation = Span> {
|
||||||
|
|||||||
Reference in New Issue
Block a user