From 5943f552e512f940d4b76055d51215c23420f03a Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sat, 30 Jan 2021 16:19:57 +0100 Subject: =?UTF-8?q?Capture=20variable=20by=20slot=20instead=20of=20value?= =?UTF-8?q?=20=F0=9F=8E=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/syntax/expr.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/syntax/expr.rs') diff --git a/src/syntax/expr.rs b/src/syntax/expr.rs index 7a055cc7..ebe82199 100644 --- a/src/syntax/expr.rs +++ b/src/syntax/expr.rs @@ -1,6 +1,6 @@ use super::*; use crate::color::RgbaColor; -use crate::eval::Value; +use crate::eval::Slot; use crate::geom::{AngularUnit, LengthUnit}; /// An expression. @@ -51,11 +51,11 @@ pub enum Expr { If(ExprIf), /// A for expression: `#for x #in y { z }`. For(ExprFor), - /// A captured value. + /// A captured variable slot. /// /// This node is never created by parsing. It only results from an in-place - /// transformation of an identifier to a captured value. - CapturedValue(Value), + /// transformation of an identifier to a captured variable. + Captured(Slot), } impl Pretty for Expr { @@ -88,7 +88,7 @@ impl Pretty for Expr { Self::Let(v) => v.pretty(p), Self::If(v) => v.pretty(p), Self::For(v) => v.pretty(p), - Self::CapturedValue(v) => v.pretty(p), + Self::Captured(v) => v.borrow().pretty(p), } } } -- cgit v1.2.3