diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-11-07 12:21:12 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-11-07 12:46:05 +0100 |
| commit | efd1853d069fbd1476e82d015da4d0d04cfaccc0 (patch) | |
| tree | 842b745c134306539d10c61be9485794fe8dc7dc /src/model/func.rs | |
| parent | eb951c008beea502042db4a3a0e8d1f8b51f6f52 (diff) | |
Show it!
- New show rule syntax
- Set if syntax
- Removed wrap syntax
Diffstat (limited to 'src/model/func.rs')
| -rw-r--r-- | src/model/func.rs | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/model/func.rs b/src/model/func.rs index 456b6aa6..8cedb158 100644 --- a/src/model/func.rs +++ b/src/model/func.rs @@ -310,16 +310,6 @@ impl<'a> CapturesVisitor<'a> { self.bind(expr.binding()); } - // A show rule contains a binding, but that binding is only active - // after the target has been evaluated. - Some(ast::Expr::Show(show)) => { - self.visit(show.pattern().as_untyped()); - if let Some(binding) = show.binding() { - self.bind(binding); - } - self.visit(show.body().as_untyped()); - } - // A for loop contains one or two bindings in its pattern. These are // active after the iterable is evaluated but before the body is // evaluated. @@ -391,9 +381,9 @@ mod tests { test("{(x, y: x + z) => x + y}", &["x", "z"]); // Show rule. - test("#show x: y as x", &["y"]); - test("#show x: y as x + z", &["y", "z"]); - test("#show x: x as x", &["x"]); + test("#show y: x => x", &["y"]); + test("#show y: x => x + z", &["y", "z"]); + test("#show x: x => x", &["x"]); // For loop. test("#for x in y { x + z }", &["y", "z"]); |
