Skip to content

Commit

Permalink
[chore] documentation updates of the expr ast
Browse files Browse the repository at this point in the history
  • Loading branch information
MangoIV committed Nov 7, 2024
1 parent e2cd9bc commit 6fbb57b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lang/parser/src/cst/exp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,15 @@ impl Exp {
}

#[derive(Debug, Clone)]
/// Either a constructor or call of a toplevel let or a variable
pub struct Call {
pub span: Span,
pub name: Ident,
pub args: Vec<Arg>,
}

#[derive(Debug, Clone)]
/// Something of the form a.b or a.b(c, ..)
pub struct DotCall {
pub span: Span,
pub exp: Box<Exp>,
Expand All @@ -94,18 +96,21 @@ pub struct DotCall {
}

#[derive(Debug, Clone)]
/// Type annotations like e : e
pub struct Anno {
pub span: Span,
pub exp: Box<Exp>,
pub typ: Box<Exp>,
}

#[derive(Debug, Clone)]
/// The Type universe (Type in Type)
pub struct TypeUniv {
pub span: Span,
}

#[derive(Debug, Clone)]
/// Pattern match, e.g. expr.match { A => .., ..}
pub struct LocalMatch {
pub span: Span,
pub name: Option<Ident>,
Expand All @@ -115,6 +120,7 @@ pub struct LocalMatch {
}

#[derive(Debug, Clone)]
/// Copattern match, e.g. comatch { .x(a, ..) => .. }
pub struct LocalComatch {
pub span: Span,
pub name: Option<Ident>,
Expand All @@ -137,19 +143,22 @@ pub struct Hole {
}

#[derive(Debug, Clone)]
/// Literal for a natural number
pub struct NatLit {
pub span: Span,
pub val: BigUint,
}

#[derive(Debug, Clone)]
/// Function arrow in syntax
pub struct Fun {
pub span: Span,
pub from: Box<Exp>,
pub to: Box<Exp>,
}

#[derive(Debug, Clone)]
/// Lambda abstractions \x. e
pub struct Lam {
pub span: Span,
pub var: BindingSite,
Expand Down

0 comments on commit 6fbb57b

Please sign in to comment.