diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-03-03 18:15:33 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-03-03 18:15:33 +0100 |
| commit | 1cfc3c72b59f96d1cef3f2e6e488b645648c36ab (patch) | |
| tree | 11bceb52a84d6cc17f0b14d39d5b5b291393b3e9 /src/syntax/expr.rs | |
| parent | c94a18833f23d2b57de1b87971458fd54b56d088 (diff) | |
Show name of user-defined functions in representation 🦋
Diffstat (limited to 'src/syntax/expr.rs')
| -rw-r--r-- | src/syntax/expr.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/syntax/expr.rs b/src/syntax/expr.rs index d76ada69..5d10349b 100644 --- a/src/syntax/expr.rs +++ b/src/syntax/expr.rs @@ -27,7 +27,7 @@ pub enum Expr { Binary(ExprBinary), /// An invocation of a function: `f(x, y)`. Call(ExprCall), - /// A closure expression: `(x, y) => { z }`. + /// A closure expression: `(x, y) => z`. Closure(ExprClosure), /// A let expression: `let x = 1`. Let(ExprLet), @@ -414,11 +414,15 @@ impl ExprArg { } } -/// A closure expression: `(x, y) => { z }`. +/// A closure expression: `(x, y) => z`. #[derive(Debug, Clone, PartialEq)] pub struct ExprClosure { /// The source code location. pub span: Span, + /// The name of the closure. + /// + /// This only exists if you use the function syntax sugar: `let f(x) = y`. + pub name: Option<Ident>, /// The parameter bindings. pub params: Rc<Vec<Ident>>, /// The body of the closure. |
