diff options
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/typst-syntax/src/ast.rs | 12 | ||||
| -rw-r--r-- | crates/typst/src/eval/func.rs | 11 |
2 files changed, 1 insertions, 22 deletions
diff --git a/crates/typst-syntax/src/ast.rs b/crates/typst-syntax/src/ast.rs index 0df3d6d3..cb1d05b2 100644 --- a/crates/typst-syntax/src/ast.rs +++ b/crates/typst-syntax/src/ast.rs @@ -1440,18 +1440,6 @@ impl BinOp { }) } - /// Whether this is an assignment operator. - pub fn is_assignment(self) -> bool { - matches!( - self, - Self::Assign - | Self::AddAssign - | Self::SubAssign - | Self::MulAssign - | Self::DivAssign - ) - } - /// The precedence of this operator. pub fn precedence(self) -> usize { match self { diff --git a/crates/typst/src/eval/func.rs b/crates/typst/src/eval/func.rs index b7951cef..3e4ea370 100644 --- a/crates/typst/src/eval/func.rs +++ b/crates/typst/src/eval/func.rs @@ -688,16 +688,6 @@ impl<'a> CapturesVisitor<'a> { } } - // Don't capture left-hand side of an assignment. - Some(ast::Expr::Binary(binary)) if binary.op().is_assignment() => { - self.visit(binary.rhs().to_untyped()); - } - - // Don't capture the left-hand side of a destructuring assignment. - Some(ast::Expr::DestructAssign(assignment)) => { - self.visit(assignment.value().to_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. @@ -828,5 +818,6 @@ mod tests { test("#(body = 1)", &[]); test("#(body += y)", &["y"]); test("#{ (body, a) = (y, 1) }", &["y"]); + test("#(x.at(y) = 5)", &["x", "y"]) } } |
