diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-06-27 12:05:36 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-06-27 12:05:36 +0200 |
| commit | f64c772b6d969fa3aa1a7391a3d8118b21430434 (patch) | |
| tree | 4829cea375ccb5c7dc864052fa80a63b9dcb6fb1 /src | |
| parent | 422b8e640f00977177a5a7250a3c56009eed10c4 (diff) | |
Fix capturing bug
Diffstat (limited to 'src')
| -rw-r--r-- | src/library/layout.rs | 4 | ||||
| -rw-r--r-- | src/syntax/visit.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/library/layout.rs b/src/library/layout.rs index 27b2e743..08924bad 100644 --- a/src/library/layout.rs +++ b/src/library/layout.rs @@ -210,7 +210,7 @@ castable! { AlignValue: "alignment", } -/// ´box`: Place content in a rectangular box. +/// `box`: Place content in a rectangular box. pub fn boxed(ctx: &mut EvalContext, args: &mut FuncArgs) -> Value { let width = args.named(ctx, "width"); let height = args.named(ctx, "height"); @@ -221,7 +221,7 @@ pub fn boxed(ctx: &mut EvalContext, args: &mut FuncArgs) -> Value { }) } -/// block`: Place content in a block. +/// `block`: Place content in a block. pub fn block(ctx: &mut EvalContext, args: &mut FuncArgs) -> Value { let body = args.eat(ctx).unwrap_or_default(); Value::template(move |ctx| { diff --git a/src/syntax/visit.rs b/src/syntax/visit.rs index cf819ef0..52418361 100644 --- a/src/syntax/visit.rs +++ b/src/syntax/visit.rs @@ -183,10 +183,10 @@ visit! { } fn visit_let(v, node: &LetExpr) { - v.visit_binding(&node.binding); if let Some(init) = &node.init { v.visit_expr(&init); } + v.visit_binding(&node.binding); } fn visit_if(v, node: &IfExpr) { @@ -203,6 +203,7 @@ visit! { } fn visit_for(v, node: &ForExpr) { + v.visit_expr(&node.iter); match &node.pattern { ForPattern::Value(value) => v.visit_binding(value), ForPattern::KeyValue(key, value) => { @@ -210,7 +211,6 @@ visit! { v.visit_binding(value); } } - v.visit_expr(&node.iter); v.visit_expr(&node.body); } |
