diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-09-16 20:38:27 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-09-16 20:41:44 +0200 |
| commit | 25613cfaf3a20f737ac347f7d7144a5dcaa709a5 (patch) | |
| tree | 150578e74ece5172133b990e9b900b8fedfecee7 /crates/typst-syntax | |
| parent | b7430f6da01550d8388d6a3bcccf0ef0aca9130c (diff) | |
Fix missing capturing of assignments
The previous commit was a bit overambitious. The left-hand side of assignments should actually be fully captured: Argument lists in `at` calls can contain captured variables. And if the assigned variable itself is captured, then the function is faulty anyway. (And we ensure the correct error message by capturing it.)
Fixes #2169
Diffstat (limited to 'crates/typst-syntax')
| -rw-r--r-- | crates/typst-syntax/src/ast.rs | 12 |
1 files changed, 0 insertions, 12 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 { |
