diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-01-27 15:05:18 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-01-27 15:05:18 +0100 |
| commit | 2036663ed25b5885a87eb3a80caec3fa2e258d77 (patch) | |
| tree | 110ca98e4d76dc887b41c91685bb202c49730236 /src/syntax/expr.rs | |
| parent | 2641c2d20ef5ddaf8e1dc91f4a69abfe2c170e4d (diff) | |
Capture variables in templates 🔍
Diffstat (limited to 'src/syntax/expr.rs')
| -rw-r--r-- | src/syntax/expr.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/syntax/expr.rs b/src/syntax/expr.rs index 15c53cc0..ca55bdd0 100644 --- a/src/syntax/expr.rs +++ b/src/syntax/expr.rs @@ -1,5 +1,6 @@ use super::*; use crate::color::RgbaColor; +use crate::eval::Value; use crate::geom::{AngularUnit, LengthUnit}; /// An expression. @@ -50,6 +51,11 @@ pub enum Expr { If(ExprIf), /// A for expression: `#for x #in y { z }`. For(ExprFor), + /// A captured value. + /// + /// This node is never created by parsing. It only results from an in-place + /// transformation of an identifier to a captured value. + CapturedValue(Value), } impl Pretty for Expr { @@ -86,6 +92,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), } } } |
