cl-ast: Add inline closure expressions
This commit is contained in:
@@ -283,6 +283,7 @@ impl WeightOf for ExprKind {
|
||||
fn weight_of(&self) -> usize {
|
||||
match self {
|
||||
ExprKind::Empty => size_of_val(self),
|
||||
ExprKind::Closure(v) => v.weight_of(),
|
||||
ExprKind::Quote(v) => v.weight_of(),
|
||||
ExprKind::Let(v) => v.weight_of(),
|
||||
ExprKind::Match(v) => v.weight_of(),
|
||||
@@ -312,6 +313,13 @@ impl WeightOf for ExprKind {
|
||||
}
|
||||
}
|
||||
|
||||
impl WeightOf for Closure {
|
||||
fn weight_of(&self) -> usize {
|
||||
let Self { arg, body } = self;
|
||||
arg.weight_of() + body.weight_of()
|
||||
}
|
||||
}
|
||||
|
||||
impl WeightOf for Quote {
|
||||
fn weight_of(&self) -> usize {
|
||||
let Self { quote } = self;
|
||||
|
||||
Reference in New Issue
Block a user